diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/datamaskingpolicies.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/datamaskingpolicies.go new file mode 100644 index 000000000000..ba8709572b50 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/datamaskingpolicies.go @@ -0,0 +1,225 @@ +package synapse + +// 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" +) + +// DataMaskingPoliciesClient is the azure Synapse Analytics Management Client +type DataMaskingPoliciesClient struct { + BaseClient +} + +// NewDataMaskingPoliciesClient creates an instance of the DataMaskingPoliciesClient client. +func NewDataMaskingPoliciesClient(subscriptionID string) DataMaskingPoliciesClient { + return NewDataMaskingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDataMaskingPoliciesClientWithBaseURI creates an instance of the DataMaskingPoliciesClient 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 NewDataMaskingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DataMaskingPoliciesClient { + return DataMaskingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a Sql pool data masking policy +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// parameters - parameters for creating or updating a data masking policy. +func (client DataMaskingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, parameters DataMaskingPolicy) (result DataMaskingPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataMaskingPoliciesClient.CreateOrUpdate") + 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.MinLength, Rule: 1, 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("synapse.DataMaskingPoliciesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.DataMaskingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.DataMaskingPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.DataMaskingPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DataMaskingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, parameters DataMaskingPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataMaskingPolicyName": autorest.Encode("path", "Default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.Location = nil + parameters.Kind = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DataMaskingPoliciesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DataMaskingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result DataMaskingPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets a Sql pool data masking policy. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +func (client DataMaskingPoliciesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result DataMaskingPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataMaskingPoliciesClient.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.MinLength, Rule: 1, 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("synapse.DataMaskingPoliciesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.DataMaskingPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.DataMaskingPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.DataMaskingPoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DataMaskingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataMaskingPolicyName": autorest.Encode("path", "Default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}", 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 DataMaskingPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DataMaskingPoliciesClient) GetResponder(resp *http.Response) (result DataMaskingPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/datamaskingrules.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/datamaskingrules.go new file mode 100644 index 000000000000..9c593c004e10 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/datamaskingrules.go @@ -0,0 +1,233 @@ +package synapse + +// 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" +) + +// DataMaskingRulesClient is the azure Synapse Analytics Management Client +type DataMaskingRulesClient struct { + BaseClient +} + +// NewDataMaskingRulesClient creates an instance of the DataMaskingRulesClient client. +func NewDataMaskingRulesClient(subscriptionID string) DataMaskingRulesClient { + return NewDataMaskingRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDataMaskingRulesClientWithBaseURI creates an instance of the DataMaskingRulesClient 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 NewDataMaskingRulesClientWithBaseURI(baseURI string, subscriptionID string) DataMaskingRulesClient { + return DataMaskingRulesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a Sql pool data masking rule. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// dataMaskingRuleName - the name of the data masking rule. +// parameters - the required parameters for creating or updating a data masking rule. +func (client DataMaskingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, dataMaskingRuleName string, parameters DataMaskingRule) (result DataMaskingRule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataMaskingRulesClient.CreateOrUpdate") + 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.MinLength, Rule: 1, 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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DataMaskingRuleProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DataMaskingRuleProperties.SchemaName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DataMaskingRuleProperties.TableName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DataMaskingRuleProperties.ColumnName", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("synapse.DataMaskingRulesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, dataMaskingRuleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.DataMaskingRulesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.DataMaskingRulesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.DataMaskingRulesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DataMaskingRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, dataMaskingRuleName string, parameters DataMaskingRule) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataMaskingPolicyName": autorest.Encode("path", "Default"), + "dataMaskingRuleName": autorest.Encode("path", dataMaskingRuleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.Location = nil + parameters.Kind = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DataMaskingRulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DataMaskingRulesClient) CreateOrUpdateResponder(resp *http.Response) (result DataMaskingRule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBySQLPool gets a list of Sql pool data masking rules. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +func (client DataMaskingRulesClient) ListBySQLPool(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result DataMaskingRuleListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataMaskingRulesClient.ListBySQLPool") + 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.MinLength, Rule: 1, 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("synapse.DataMaskingRulesClient", "ListBySQLPool", err.Error()) + } + + req, err := client.ListBySQLPoolPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.DataMaskingRulesClient", "ListBySQLPool", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySQLPoolSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.DataMaskingRulesClient", "ListBySQLPool", resp, "Failure sending request") + return + } + + result, err = client.ListBySQLPoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.DataMaskingRulesClient", "ListBySQLPool", resp, "Failure responding to request") + } + + return +} + +// ListBySQLPoolPreparer prepares the ListBySQLPool request. +func (client DataMaskingRulesClient) ListBySQLPoolPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataMaskingPolicyName": autorest.Encode("path", "Default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySQLPoolSender sends the ListBySQLPool request. The method will close the +// http.Response Body if it receives an error. +func (client DataMaskingRulesClient) ListBySQLPoolSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySQLPoolResponder handles the response to the ListBySQLPool request. The method always +// closes the http.Response Body. +func (client DataMaskingRulesClient) ListBySQLPoolResponder(resp *http.Response) (result DataMaskingRuleListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/enums.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/enums.go index ed38d8246a08..25f28a514750 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/enums.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/enums.go @@ -166,6 +166,59 @@ func PossibleDataFlowComputeTypeValues() []DataFlowComputeType { return []DataFlowComputeType{ComputeOptimized, General, MemoryOptimized} } +// DataMaskingFunction enumerates the values for data masking function. +type DataMaskingFunction string + +const ( + // DataMaskingFunctionCCN ... + DataMaskingFunctionCCN DataMaskingFunction = "CCN" + // DataMaskingFunctionDefault ... + DataMaskingFunctionDefault DataMaskingFunction = "Default" + // DataMaskingFunctionEmail ... + DataMaskingFunctionEmail DataMaskingFunction = "Email" + // DataMaskingFunctionNumber ... + DataMaskingFunctionNumber DataMaskingFunction = "Number" + // DataMaskingFunctionSSN ... + DataMaskingFunctionSSN DataMaskingFunction = "SSN" + // DataMaskingFunctionText ... + DataMaskingFunctionText DataMaskingFunction = "Text" +) + +// PossibleDataMaskingFunctionValues returns an array of possible values for the DataMaskingFunction const type. +func PossibleDataMaskingFunctionValues() []DataMaskingFunction { + return []DataMaskingFunction{DataMaskingFunctionCCN, DataMaskingFunctionDefault, DataMaskingFunctionEmail, DataMaskingFunctionNumber, DataMaskingFunctionSSN, DataMaskingFunctionText} +} + +// DataMaskingRuleState enumerates the values for data masking rule state. +type DataMaskingRuleState string + +const ( + // DataMaskingRuleStateDisabled ... + DataMaskingRuleStateDisabled DataMaskingRuleState = "Disabled" + // DataMaskingRuleStateEnabled ... + DataMaskingRuleStateEnabled DataMaskingRuleState = "Enabled" +) + +// PossibleDataMaskingRuleStateValues returns an array of possible values for the DataMaskingRuleState const type. +func PossibleDataMaskingRuleStateValues() []DataMaskingRuleState { + return []DataMaskingRuleState{DataMaskingRuleStateDisabled, DataMaskingRuleStateEnabled} +} + +// DataMaskingState enumerates the values for data masking state. +type DataMaskingState string + +const ( + // DataMaskingStateDisabled ... + DataMaskingStateDisabled DataMaskingState = "Disabled" + // DataMaskingStateEnabled ... + DataMaskingStateEnabled DataMaskingState = "Enabled" +) + +// PossibleDataMaskingStateValues returns an array of possible values for the DataMaskingState const type. +func PossibleDataMaskingStateValues() []DataMaskingState { + return []DataMaskingState{DataMaskingStateDisabled, DataMaskingStateEnabled} +} + // DesiredState enumerates the values for desired state. type DesiredState string @@ -430,11 +483,13 @@ const ( NodeSizeXLarge NodeSize = "XLarge" // NodeSizeXXLarge ... NodeSizeXXLarge NodeSize = "XXLarge" + // NodeSizeXXXLarge ... + NodeSizeXXXLarge NodeSize = "XXXLarge" ) // PossibleNodeSizeValues returns an array of possible values for the NodeSize const type. func PossibleNodeSizeValues() []NodeSize { - return []NodeSize{NodeSizeLarge, NodeSizeMedium, NodeSizeNone, NodeSizeSmall, NodeSizeXLarge, NodeSizeXXLarge} + return []NodeSize{NodeSizeLarge, NodeSizeMedium, NodeSizeNone, NodeSizeSmall, NodeSizeXLarge, NodeSizeXXLarge, NodeSizeXXXLarge} } // NodeSizeFamily enumerates the values for node size family. @@ -492,21 +547,6 @@ func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{ProvisioningStateDeleteError, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateProvisioning, ProvisioningStateSucceeded} } -// ProvisioningState1 enumerates the values for provisioning state 1. -type ProvisioningState1 string - -const ( - // ProvisioningState1Failed ... - ProvisioningState1Failed ProvisioningState1 = "Failed" - // ProvisioningState1Succeeded ... - ProvisioningState1Succeeded ProvisioningState1 = "Succeeded" -) - -// PossibleProvisioningState1Values returns an array of possible values for the ProvisioningState1 const type. -func PossibleProvisioningState1Values() []ProvisioningState1 { - return []ProvisioningState1{ProvisioningState1Failed, ProvisioningState1Succeeded} -} - // QueryAggregationFunction enumerates the values for query aggregation function. type QueryAggregationFunction string @@ -698,6 +738,36 @@ func PossibleSelfHostedIntegrationRuntimeNodeStatusValues() []SelfHostedIntegrat return []SelfHostedIntegrationRuntimeNodeStatus{SelfHostedIntegrationRuntimeNodeStatusInitializeFailed, SelfHostedIntegrationRuntimeNodeStatusInitializing, SelfHostedIntegrationRuntimeNodeStatusLimited, SelfHostedIntegrationRuntimeNodeStatusNeedRegistration, SelfHostedIntegrationRuntimeNodeStatusOffline, SelfHostedIntegrationRuntimeNodeStatusOnline, SelfHostedIntegrationRuntimeNodeStatusUpgrading} } +// SensitivityLabelSource enumerates the values for sensitivity label source. +type SensitivityLabelSource string + +const ( + // Current ... + Current SensitivityLabelSource = "current" + // Recommended ... + Recommended SensitivityLabelSource = "recommended" +) + +// PossibleSensitivityLabelSourceValues returns an array of possible values for the SensitivityLabelSource const type. +func PossibleSensitivityLabelSourceValues() []SensitivityLabelSource { + return []SensitivityLabelSource{Current, Recommended} +} + +// ServerKeyType enumerates the values for server key type. +type ServerKeyType string + +const ( + // AzureKeyVault ... + AzureKeyVault ServerKeyType = "AzureKeyVault" + // ServiceManaged ... + ServiceManaged ServerKeyType = "ServiceManaged" +) + +// PossibleServerKeyTypeValues returns an array of possible values for the ServerKeyType const type. +func PossibleServerKeyTypeValues() []ServerKeyType { + return []ServerKeyType{AzureKeyVault, ServiceManaged} +} + // SsisObjectMetadataType enumerates the values for ssis object metadata type. type SsisObjectMetadataType string @@ -717,25 +787,6 @@ func PossibleSsisObjectMetadataTypeValues() []SsisObjectMetadataType { return []SsisObjectMetadataType{Environment, Folder, Package, Project} } -// Status enumerates the values for status. -type Status string - -const ( - // StatusApproved ... - StatusApproved Status = "Approved" - // StatusDisconnected ... - StatusDisconnected Status = "Disconnected" - // StatusPending ... - StatusPending Status = "Pending" - // StatusRejected ... - StatusRejected Status = "Rejected" -) - -// PossibleStatusValues returns an array of possible values for the Status const type. -func PossibleStatusValues() []Status { - return []Status{StatusApproved, StatusDisconnected, StatusPending, StatusRejected} -} - // TransparentDataEncryptionStatus enumerates the values for transparent data encryption status. type TransparentDataEncryptionStatus string diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/extendedsqlpoolblobauditingpolicies.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/extendedsqlpoolblobauditingpolicies.go new file mode 100644 index 000000000000..bda413893dca --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/extendedsqlpoolblobauditingpolicies.go @@ -0,0 +1,352 @@ +package synapse + +// 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" +) + +// ExtendedSQLPoolBlobAuditingPoliciesClient is the azure Synapse Analytics Management Client +type ExtendedSQLPoolBlobAuditingPoliciesClient struct { + BaseClient +} + +// NewExtendedSQLPoolBlobAuditingPoliciesClient creates an instance of the ExtendedSQLPoolBlobAuditingPoliciesClient +// client. +func NewExtendedSQLPoolBlobAuditingPoliciesClient(subscriptionID string) ExtendedSQLPoolBlobAuditingPoliciesClient { + return NewExtendedSQLPoolBlobAuditingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExtendedSQLPoolBlobAuditingPoliciesClientWithBaseURI creates an instance of the +// ExtendedSQLPoolBlobAuditingPoliciesClient 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 NewExtendedSQLPoolBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ExtendedSQLPoolBlobAuditingPoliciesClient { + return ExtendedSQLPoolBlobAuditingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an extended Sql pool's blob auditing policy. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// parameters - the extended Sql pool blob auditing policy. +func (client ExtendedSQLPoolBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, parameters ExtendedSQLPoolBlobAuditingPolicy) (result ExtendedSQLPoolBlobAuditingPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedSQLPoolBlobAuditingPoliciesClient.CreateOrUpdate") + 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.MinLength, Rule: 1, 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("synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ExtendedSQLPoolBlobAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, parameters ExtendedSQLPoolBlobAuditingPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "blobAuditingPolicyName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/extendedAuditingSettings/{blobAuditingPolicyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ExtendedSQLPoolBlobAuditingPoliciesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ExtendedSQLPoolBlobAuditingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ExtendedSQLPoolBlobAuditingPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets an extended Sql pool's blob auditing policy. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +func (client ExtendedSQLPoolBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result ExtendedSQLPoolBlobAuditingPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedSQLPoolBlobAuditingPoliciesClient.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.MinLength, Rule: 1, 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("synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExtendedSQLPoolBlobAuditingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "blobAuditingPolicyName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/extendedAuditingSettings/{blobAuditingPolicyName}", 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 ExtendedSQLPoolBlobAuditingPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ExtendedSQLPoolBlobAuditingPoliciesClient) GetResponder(resp *http.Response) (result ExtendedSQLPoolBlobAuditingPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBySQLPool lists extended auditing settings of a Sql pool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +func (client ExtendedSQLPoolBlobAuditingPoliciesClient) ListBySQLPool(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result ExtendedSQLPoolBlobAuditingPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedSQLPoolBlobAuditingPoliciesClient.ListBySQLPool") + defer func() { + sc := -1 + if result.espbaplr.Response.Response != nil { + sc = result.espbaplr.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.MinLength, Rule: 1, 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("synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "ListBySQLPool", err.Error()) + } + + result.fn = client.listBySQLPoolNextResults + req, err := client.ListBySQLPoolPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "ListBySQLPool", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySQLPoolSender(req) + if err != nil { + result.espbaplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "ListBySQLPool", resp, "Failure sending request") + return + } + + result.espbaplr, err = client.ListBySQLPoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "ListBySQLPool", resp, "Failure responding to request") + } + if result.espbaplr.hasNextLink() && result.espbaplr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListBySQLPoolPreparer prepares the ListBySQLPool request. +func (client ExtendedSQLPoolBlobAuditingPoliciesClient) ListBySQLPoolPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/extendedAuditingSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySQLPoolSender sends the ListBySQLPool request. The method will close the +// http.Response Body if it receives an error. +func (client ExtendedSQLPoolBlobAuditingPoliciesClient) ListBySQLPoolSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySQLPoolResponder handles the response to the ListBySQLPool request. The method always +// closes the http.Response Body. +func (client ExtendedSQLPoolBlobAuditingPoliciesClient) ListBySQLPoolResponder(resp *http.Response) (result ExtendedSQLPoolBlobAuditingPolicyListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySQLPoolNextResults retrieves the next set of results, if any. +func (client ExtendedSQLPoolBlobAuditingPoliciesClient) listBySQLPoolNextResults(ctx context.Context, lastResults ExtendedSQLPoolBlobAuditingPolicyListResult) (result ExtendedSQLPoolBlobAuditingPolicyListResult, err error) { + req, err := lastResults.extendedSQLPoolBlobAuditingPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "listBySQLPoolNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySQLPoolSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "listBySQLPoolNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySQLPoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.ExtendedSQLPoolBlobAuditingPoliciesClient", "listBySQLPoolNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySQLPoolComplete enumerates all values, automatically crossing page boundaries as required. +func (client ExtendedSQLPoolBlobAuditingPoliciesClient) ListBySQLPoolComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result ExtendedSQLPoolBlobAuditingPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedSQLPoolBlobAuditingPoliciesClient.ListBySQLPool") + 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.ListBySQLPool(ctx, resourceGroupName, workspaceName, SQLPoolName) + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimemonitoringdata.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimemonitoringdata.go index 9cc9e188c904..c01b45e1bf0f 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimemonitoringdata.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimemonitoringdata.go @@ -43,14 +43,14 @@ func NewIntegrationRuntimeMonitoringDataClientWithBaseURI(baseURI string, subscr return IntegrationRuntimeMonitoringDataClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get get monitoring data for an integration runtime +// List get monitoring data for an integration runtime // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // workspaceName - the name of the workspace // integrationRuntimeName - integration runtime name -func (client IntegrationRuntimeMonitoringDataClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result IntegrationRuntimeMonitoringData, err error) { +func (client IntegrationRuntimeMonitoringDataClient) List(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result IntegrationRuntimeMonitoringData, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeMonitoringDataClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeMonitoringDataClient.List") defer func() { sc := -1 if result.Response.Response != nil { @@ -66,32 +66,32 @@ func (client IntegrationRuntimeMonitoringDataClient) Get(ctx context.Context, re 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("synapse.IntegrationRuntimeMonitoringDataClient", "Get", err.Error()) + return result, validation.NewError("synapse.IntegrationRuntimeMonitoringDataClient", "List", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName) + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName) if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeMonitoringDataClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeMonitoringDataClient", "List", nil, "Failure preparing request") return } - resp, err := client.GetSender(req) + resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeMonitoringDataClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeMonitoringDataClient", "List", resp, "Failure sending request") return } - result, err = client.GetResponder(resp) + result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeMonitoringDataClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeMonitoringDataClient", "List", resp, "Failure responding to request") } return } -// GetPreparer prepares the Get request. -func (client IntegrationRuntimeMonitoringDataClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (*http.Request, error) { +// ListPreparer prepares the List request. +func (client IntegrationRuntimeMonitoringDataClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -112,15 +112,15 @@ func (client IntegrationRuntimeMonitoringDataClient) GetPreparer(ctx context.Con return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSender sends the Get request. The method will close the +// ListSender sends the List request. The method will close the // http.Response Body if it receives an error. -func (client IntegrationRuntimeMonitoringDataClient) GetSender(req *http.Request) (*http.Response, error) { +func (client IntegrationRuntimeMonitoringDataClient) ListSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// GetResponder handles the response to the Get request. The method always +// ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client IntegrationRuntimeMonitoringDataClient) GetResponder(resp *http.Response) (result IntegrationRuntimeMonitoringData, err error) { +func (client IntegrationRuntimeMonitoringDataClient) ListResponder(resp *http.Response) (result IntegrationRuntimeMonitoringData, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimeobjectmetadata.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimeobjectmetadata.go index db1273ff0965..778b83e0cf49 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimeobjectmetadata.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimeobjectmetadata.go @@ -43,15 +43,15 @@ func NewIntegrationRuntimeObjectMetadataClientWithBaseURI(baseURI string, subscr return IntegrationRuntimeObjectMetadataClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get get object metadata from an integration runtime +// List get object metadata from an integration runtime // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // workspaceName - the name of the workspace // integrationRuntimeName - integration runtime name // getMetadataRequest - the parameters for getting a SSIS object metadata. -func (client IntegrationRuntimeObjectMetadataClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, getMetadataRequest *GetSsisObjectMetadataRequest) (result SsisObjectMetadataListResponse, err error) { +func (client IntegrationRuntimeObjectMetadataClient) List(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, getMetadataRequest *GetSsisObjectMetadataRequest) (result SsisObjectMetadataListResponse, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeObjectMetadataClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeObjectMetadataClient.List") defer func() { sc := -1 if result.Response.Response != nil { @@ -67,32 +67,32 @@ func (client IntegrationRuntimeObjectMetadataClient) Get(ctx context.Context, re 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("synapse.IntegrationRuntimeObjectMetadataClient", "Get", err.Error()) + return result, validation.NewError("synapse.IntegrationRuntimeObjectMetadataClient", "List", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName, getMetadataRequest) + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName, getMetadataRequest) if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataClient", "List", nil, "Failure preparing request") return } - resp, err := client.GetSender(req) + resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataClient", "List", resp, "Failure sending request") return } - result, err = client.GetResponder(resp) + result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataClient", "List", resp, "Failure responding to request") } return } -// GetPreparer prepares the Get request. -func (client IntegrationRuntimeObjectMetadataClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, getMetadataRequest *GetSsisObjectMetadataRequest) (*http.Request, error) { +// ListPreparer prepares the List request. +func (client IntegrationRuntimeObjectMetadataClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, getMetadataRequest *GetSsisObjectMetadataRequest) (*http.Request, error) { pathParameters := map[string]interface{}{ "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -118,15 +118,15 @@ func (client IntegrationRuntimeObjectMetadataClient) GetPreparer(ctx context.Con return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSender sends the Get request. The method will close the +// ListSender sends the List request. The method will close the // http.Response Body if it receives an error. -func (client IntegrationRuntimeObjectMetadataClient) GetSender(req *http.Request) (*http.Response, error) { +func (client IntegrationRuntimeObjectMetadataClient) ListSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// GetResponder handles the response to the Get request. The method always +// ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client IntegrationRuntimeObjectMetadataClient) GetResponder(resp *http.Response) (result SsisObjectMetadataListResponse, err error) { +func (client IntegrationRuntimeObjectMetadataClient) ListResponder(resp *http.Response) (result SsisObjectMetadataListResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -141,13 +141,13 @@ func (client IntegrationRuntimeObjectMetadataClient) GetResponder(resp *http.Res // resourceGroupName - the name of the resource group. The name is case insensitive. // workspaceName - the name of the workspace // integrationRuntimeName - integration runtime name -func (client IntegrationRuntimeObjectMetadataClient) Refresh(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result SsisObjectMetadataStatusResponse, err error) { +func (client IntegrationRuntimeObjectMetadataClient) Refresh(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result IntegrationRuntimeObjectMetadataRefreshFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeObjectMetadataClient.Refresh") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -168,18 +168,12 @@ func (client IntegrationRuntimeObjectMetadataClient) Refresh(ctx context.Context return } - resp, err := client.RefreshSender(req) + result, err = client.RefreshSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataClient", "Refresh", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataClient", "Refresh", result.Response(), "Failure sending request") return } - result, err = client.RefreshResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataClient", "Refresh", resp, "Failure responding to request") - } - return } @@ -207,8 +201,14 @@ func (client IntegrationRuntimeObjectMetadataClient) RefreshPreparer(ctx context // RefreshSender sends the Refresh request. The method will close the // http.Response Body if it receives an error. -func (client IntegrationRuntimeObjectMetadataClient) RefreshSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client IntegrationRuntimeObjectMetadataClient) RefreshSender(req *http.Request) (future IntegrationRuntimeObjectMetadataRefreshFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // RefreshResponder handles the response to the Refresh request. The method always diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimes.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimes.go index 160be4d4f5ae..eadddf56b633 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimes.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimes.go @@ -227,6 +227,92 @@ func (client IntegrationRuntimesClient) DeleteResponder(resp *http.Response) (re return } +// EnableInteractiveQuery enable interactive query in integration runtime +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// integrationRuntimeName - integration runtime name +func (client IntegrationRuntimesClient) EnableInteractiveQuery(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result IntegrationRuntimesEnableInteractiveQueryFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimesClient.EnableInteractiveQuery") + 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.MinLength, Rule: 1, 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("synapse.IntegrationRuntimesClient", "EnableInteractiveQuery", err.Error()) + } + + req, err := client.EnableInteractiveQueryPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "EnableInteractiveQuery", nil, "Failure preparing request") + return + } + + result, err = client.EnableInteractiveQuerySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "EnableInteractiveQuery", result.Response(), "Failure sending request") + return + } + + return +} + +// EnableInteractiveQueryPreparer prepares the EnableInteractiveQuery request. +func (client IntegrationRuntimesClient) EnableInteractiveQueryPreparer(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/enableInteractiveQuery", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// EnableInteractiveQuerySender sends the EnableInteractiveQuery request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) EnableInteractiveQuerySender(req *http.Request) (future IntegrationRuntimesEnableInteractiveQueryFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// EnableInteractiveQueryResponder handles the response to the EnableInteractiveQuery request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) EnableInteractiveQueryResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + // Get get an integration runtime // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. @@ -451,13 +537,13 @@ func (client IntegrationRuntimesClient) ListByWorkspaceComplete(ctx context.Cont // resourceGroupName - the name of the resource group. The name is case insensitive. // workspaceName - the name of the workspace // integrationRuntimeName - integration runtime name -func (client IntegrationRuntimesClient) Start(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result IntegrationRuntimeStatusResponse, err error) { +func (client IntegrationRuntimesClient) Start(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result IntegrationRuntimesStartFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimesClient.Start") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -478,18 +564,12 @@ func (client IntegrationRuntimesClient) Start(ctx context.Context, resourceGroup return } - resp, err := client.StartSender(req) + result, err = client.StartSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Start", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Start", result.Response(), "Failure sending request") return } - result, err = client.StartResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Start", resp, "Failure responding to request") - } - return } @@ -517,8 +597,14 @@ func (client IntegrationRuntimesClient) StartPreparer(ctx context.Context, resou // StartSender sends the Start request. The method will close the // http.Response Body if it receives an error. -func (client IntegrationRuntimesClient) StartSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client IntegrationRuntimesClient) StartSender(req *http.Request) (future IntegrationRuntimesStartFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // StartResponder handles the response to the Start request. The method always @@ -538,13 +624,13 @@ func (client IntegrationRuntimesClient) StartResponder(resp *http.Response) (res // resourceGroupName - the name of the resource group. The name is case insensitive. // workspaceName - the name of the workspace // integrationRuntimeName - integration runtime name -func (client IntegrationRuntimesClient) Stop(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result autorest.Response, err error) { +func (client IntegrationRuntimesClient) Stop(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result IntegrationRuntimesStopFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimesClient.Stop") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -565,18 +651,12 @@ func (client IntegrationRuntimesClient) Stop(ctx context.Context, resourceGroupN return } - resp, err := client.StopSender(req) + result, err = client.StopSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Stop", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Stop", result.Response(), "Failure sending request") return } - result, err = client.StopResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Stop", resp, "Failure responding to request") - } - return } @@ -604,8 +684,14 @@ func (client IntegrationRuntimesClient) StopPreparer(ctx context.Context, resour // StopSender sends the Stop request. The method will close the // http.Response Body if it receives an error. -func (client IntegrationRuntimesClient) StopSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client IntegrationRuntimesClient) StopSender(req *http.Request) (future IntegrationRuntimesStopFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // StopResponder handles the response to the Stop request. The method always diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/keys.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/keys.go new file mode 100644 index 000000000000..bd753cd19b11 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/keys.go @@ -0,0 +1,433 @@ +package synapse + +// 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" +) + +// KeysClient is the azure Synapse Analytics Management Client +type KeysClient struct { + BaseClient +} + +// NewKeysClient creates an instance of the KeysClient client. +func NewKeysClient(subscriptionID string) KeysClient { + return NewKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewKeysClientWithBaseURI creates an instance of the KeysClient 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 NewKeysClientWithBaseURI(baseURI string, subscriptionID string) KeysClient { + return KeysClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a workspace key +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// keyName - the name of the workspace key +// keyProperties - key put request properties +func (client KeysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, keyName string, keyProperties Key) (result Key, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KeysClient.CreateOrUpdate") + 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.MinLength, Rule: 1, 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("synapse.KeysClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, keyName, keyProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.KeysClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.KeysClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.KeysClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client KeysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, keyName string, keyProperties Key) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "keyName": autorest.Encode("path", keyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/keys/{keyName}", pathParameters), + autorest.WithJSON(keyProperties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client KeysClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client KeysClient) CreateOrUpdateResponder(resp *http.Response) (result Key, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a workspace key +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// keyName - the name of the workspace key +func (client KeysClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, keyName string) (result Key, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KeysClient.Delete") + 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.MinLength, Rule: 1, 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("synapse.KeysClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, keyName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.KeysClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.KeysClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.KeysClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client KeysClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, keyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "keyName": autorest.Encode("path", keyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/keys/{keyName}", 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 KeysClient) 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 KeysClient) DeleteResponder(resp *http.Response) (result Key, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets a workspace key +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// keyName - the name of the workspace key +func (client KeysClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, keyName string) (result Key, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KeysClient.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.MinLength, Rule: 1, 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("synapse.KeysClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, keyName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.KeysClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.KeysClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.KeysClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client KeysClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, keyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "keyName": autorest.Encode("path", keyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/keys/{keyName}", 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 KeysClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client KeysClient) GetResponder(resp *http.Response) (result Key, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace returns a list of keys in a workspace +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client KeysClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result KeyInfoListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KeysClient.ListByWorkspace") + defer func() { + sc := -1 + if result.kilr.Response.Response != nil { + sc = result.kilr.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.MinLength, Rule: 1, 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("synapse.KeysClient", "ListByWorkspace", err.Error()) + } + + result.fn = client.listByWorkspaceNextResults + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.KeysClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.kilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.KeysClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result.kilr, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.KeysClient", "ListByWorkspace", resp, "Failure responding to request") + } + if result.kilr.hasNextLink() && result.kilr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client KeysClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/keys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client KeysClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client KeysClient) ListByWorkspaceResponder(resp *http.Response) (result KeyInfoListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByWorkspaceNextResults retrieves the next set of results, if any. +func (client KeysClient) listByWorkspaceNextResults(ctx context.Context, lastResults KeyInfoListResult) (result KeyInfoListResult, err error) { + req, err := lastResults.keyInfoListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.KeysClient", "listByWorkspaceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "synapse.KeysClient", "listByWorkspaceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.KeysClient", "listByWorkspaceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByWorkspaceComplete enumerates all values, automatically crossing page boundaries as required. +func (client KeysClient) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result KeyInfoListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KeysClient.ListByWorkspace") + 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.ListByWorkspace(ctx, resourceGroupName, workspaceName) + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/models.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/models.go index 659a43626361..f9cd12cccf2f 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/models.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/models.go @@ -169,18 +169,24 @@ type AvailableRpOperationDisplayInfo struct { Operation *string `json:"operation,omitempty"` } -// AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag. +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. type AzureEntityResource struct { // Etag - READ-ONLY; Resource Etag. Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } +// BabylonConfiguration babylon Configuration +type BabylonConfiguration struct { + // BabylonResourceID - Babylon Resource ID + BabylonResourceID *string `json:"babylonResourceId,omitempty"` +} + // BigDataPoolPatchInfo properties patch for a Big Data pool type BigDataPoolPatchInfo struct { // Tags - Updated tags for the Big Data pool @@ -205,11 +211,11 @@ type BigDataPoolResourceInfo struct { Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -306,8 +312,8 @@ type BigDataPoolResourceInfoListResult struct { Value *[]BigDataPoolResourceInfo `json:"value,omitempty"` } -// BigDataPoolResourceInfoListResultIterator provides access to a complete listing of BigDataPoolResourceInfo -// values. +// BigDataPoolResourceInfoListResultIterator provides access to a complete listing of +// BigDataPoolResourceInfo values. type BigDataPoolResourceInfoListResultIterator struct { i int page BigDataPoolResourceInfoListResultPage @@ -450,8 +456,11 @@ func (page BigDataPoolResourceInfoListResultPage) Values() []BigDataPoolResource } // Creates a new instance of the BigDataPoolResourceInfoListResultPage type. -func NewBigDataPoolResourceInfoListResultPage(getNextPage func(context.Context, BigDataPoolResourceInfoListResult) (BigDataPoolResourceInfoListResult, error)) BigDataPoolResourceInfoListResultPage { - return BigDataPoolResourceInfoListResultPage{fn: getNextPage} +func NewBigDataPoolResourceInfoListResultPage(cur BigDataPoolResourceInfoListResult, getNextPage func(context.Context, BigDataPoolResourceInfoListResult) (BigDataPoolResourceInfoListResult, error)) BigDataPoolResourceInfoListResultPage { + return BigDataPoolResourceInfoListResultPage{ + fn: getNextPage, + bdprilr: cur, + } } // BigDataPoolResourceProperties properties of a Big Data pool powered by Apache Spark @@ -466,24 +475,30 @@ type BigDataPoolResourceProperties struct { AutoPause *AutoPauseProperties `json:"autoPause,omitempty"` // IsComputeIsolationEnabled - Whether compute isolation is required or not. IsComputeIsolationEnabled *bool `json:"isComputeIsolationEnabled,omitempty"` + // SessionLevelPackagesEnabled - Whether session level library/package management is enabled or not. + SessionLevelPackagesEnabled *bool `json:"sessionLevelPackagesEnabled,omitempty"` // SparkEventsFolder - The Spark events folder SparkEventsFolder *string `json:"sparkEventsFolder,omitempty"` // NodeCount - The number of nodes in the Big Data pool. NodeCount *int32 `json:"nodeCount,omitempty"` // LibraryRequirements - Library version requirements LibraryRequirements *LibraryRequirements `json:"libraryRequirements,omitempty"` + // CustomLibraries - List of custom libraries/packages associated with the spark pool. + CustomLibraries *[]LibraryInfo `json:"customLibraries,omitempty"` + // SparkConfigProperties - Spark configuration file to specify additional properties + SparkConfigProperties *LibraryRequirements `json:"sparkConfigProperties,omitempty"` // SparkVersion - The Apache Spark version. SparkVersion *string `json:"sparkVersion,omitempty"` // DefaultSparkLogFolder - The default folder where Spark logs will be written. DefaultSparkLogFolder *string `json:"defaultSparkLogFolder,omitempty"` - // NodeSize - The level of compute power that each node in the Big Data pool has. Possible values include: 'NodeSizeNone', 'NodeSizeSmall', 'NodeSizeMedium', 'NodeSizeLarge', 'NodeSizeXLarge', 'NodeSizeXXLarge' + // NodeSize - The level of compute power that each node in the Big Data pool has. Possible values include: 'NodeSizeNone', 'NodeSizeSmall', 'NodeSizeMedium', 'NodeSizeLarge', 'NodeSizeXLarge', 'NodeSizeXXLarge', 'NodeSizeXXXLarge' NodeSize NodeSize `json:"nodeSize,omitempty"` // NodeSizeFamily - The kind of nodes that the Big Data pool provides. Possible values include: 'NodeSizeFamilyNone', 'NodeSizeFamilyMemoryOptimized' NodeSizeFamily NodeSizeFamily `json:"nodeSizeFamily,omitempty"` } -// BigDataPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// BigDataPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type BigDataPoolsCreateOrUpdateFuture struct { azure.Future } @@ -821,13 +836,30 @@ func (cs *ComponentSetup) UnmarshalJSON(body []byte) error { return nil } -// CreateSQLPoolRestorePointDefinition contains the information necessary to perform a create Sql pool restore -// point operation. +// CreateSQLPoolRestorePointDefinition contains the information necessary to perform a create Sql pool +// restore point operation. type CreateSQLPoolRestorePointDefinition struct { // RestorePointLabel - The restore point label to apply RestorePointLabel *string `json:"restorePointLabel,omitempty"` } +// CustomerManagedKeyDetails details of the customer managed key associated with the workspace +type CustomerManagedKeyDetails struct { + // Status - READ-ONLY; The customer managed key status on the workspace + Status *string `json:"status,omitempty"` + // Key - The key object of the workspace + Key *WorkspaceKeyDetails `json:"key,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomerManagedKeyDetails. +func (cmkd CustomerManagedKeyDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cmkd.Key != nil { + objectMap["key"] = cmkd.Key + } + return json.Marshal(objectMap) +} + // BasicCustomSetupBase the base definition of the custom setup. type BasicCustomSetupBase interface { AsCmdkeySetup() (*CmdkeySetup, bool) @@ -930,30 +962,34 @@ type DataLakeStorageAccountDetails struct { Filesystem *string `json:"filesystem,omitempty"` } -// DataWarehouseUserActivities user activities of a data warehouse -type DataWarehouseUserActivities struct { +// DataMaskingPolicy ... +type DataMaskingPolicy struct { autorest.Response `json:"-"` - // DataWarehouseUserActivitiesProperties - Resource properties. - *DataWarehouseUserActivitiesProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // DataMaskingPolicyProperties - The properties of the data masking policy. + *DataMaskingPolicyProperties `json:"properties,omitempty"` + // Location - READ-ONLY; The location of the data masking policy. + Location *string `json:"location,omitempty"` + // Kind - READ-ONLY; The kind of data masking policy. Metadata, used for Azure portal. + Kind *string `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for DataWarehouseUserActivities. -func (dwua DataWarehouseUserActivities) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DataMaskingPolicy. +func (dmp DataMaskingPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dwua.DataWarehouseUserActivitiesProperties != nil { - objectMap["properties"] = dwua.DataWarehouseUserActivitiesProperties + if dmp.DataMaskingPolicyProperties != nil { + objectMap["properties"] = dmp.DataMaskingPolicyProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DataWarehouseUserActivities struct. -func (dwua *DataWarehouseUserActivities) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for DataMaskingPolicy struct. +func (dmp *DataMaskingPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -963,12 +999,30 @@ func (dwua *DataWarehouseUserActivities) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var dataWarehouseUserActivitiesProperties DataWarehouseUserActivitiesProperties - err = json.Unmarshal(*v, &dataWarehouseUserActivitiesProperties) + var dataMaskingPolicyProperties DataMaskingPolicyProperties + err = json.Unmarshal(*v, &dataMaskingPolicyProperties) if err != nil { return err } - dwua.DataWarehouseUserActivitiesProperties = &dataWarehouseUserActivitiesProperties + dmp.DataMaskingPolicyProperties = &dataMaskingPolicyProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dmp.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dmp.Kind = &kind } case "id": if v != nil { @@ -977,7 +1031,7 @@ func (dwua *DataWarehouseUserActivities) UnmarshalJSON(body []byte) error { if err != nil { return err } - dwua.ID = &ID + dmp.ID = &ID } case "name": if v != nil { @@ -986,7 +1040,7 @@ func (dwua *DataWarehouseUserActivities) UnmarshalJSON(body []byte) error { if err != nil { return err } - dwua.Name = &name + dmp.Name = &name } case "type": if v != nil { @@ -995,7 +1049,7 @@ func (dwua *DataWarehouseUserActivities) UnmarshalJSON(body []byte) error { if err != nil { return err } - dwua.Type = &typeVar + dmp.Type = &typeVar } } } @@ -1003,70 +1057,58 @@ func (dwua *DataWarehouseUserActivities) UnmarshalJSON(body []byte) error { return nil } -// DataWarehouseUserActivitiesProperties user activities of a data warehouse. This currently includes the count -// of running or suspended queries. For more information, please view the sys.dm_pdw_exec_requests dynamic -// management view (DMV). -type DataWarehouseUserActivitiesProperties struct { - // ActiveQueriesCount - READ-ONLY; Count of running and suspended queries. - ActiveQueriesCount *int32 `json:"activeQueriesCount,omitempty"` -} - -// EntityReference the entity reference. -type EntityReference struct { - // Type - The type of this referenced entity. Possible values include: 'IntegrationRuntimeReference', 'LinkedServiceReference' - Type IntegrationRuntimeEntityReferenceType `json:"type,omitempty"` - // ReferenceName - The name of this referenced entity. - ReferenceName *string `json:"referenceName,omitempty"` -} - -// EnvironmentVariableSetup the custom setup of setting environment variable. -type EnvironmentVariableSetup struct { - // EnvironmentVariableSetupTypeProperties - Add environment variable type properties. - *EnvironmentVariableSetupTypeProperties `json:"typeProperties,omitempty"` - // Type - Possible values include: 'TypeCustomSetupBase', 'TypeCmdkeySetup', 'TypeEnvironmentVariableSetup', 'TypeComponentSetup' - Type TypeBasicCustomSetupBase `json:"type,omitempty"` +// DataMaskingPolicyProperties the properties of a database data masking policy. +type DataMaskingPolicyProperties struct { + // DataMaskingState - The state of the data masking policy. Possible values include: 'DataMaskingStateDisabled', 'DataMaskingStateEnabled' + DataMaskingState DataMaskingState `json:"dataMaskingState,omitempty"` + // ExemptPrincipals - The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries. + ExemptPrincipals *string `json:"exemptPrincipals,omitempty"` + // ApplicationPrincipals - READ-ONLY; The list of the application principals. This is a legacy parameter and is no longer used. + ApplicationPrincipals *string `json:"applicationPrincipals,omitempty"` + // MaskingLevel - READ-ONLY; The masking level. This is a legacy parameter and is no longer used. + MaskingLevel *string `json:"maskingLevel,omitempty"` } -// MarshalJSON is the custom marshaler for EnvironmentVariableSetup. -func (evs EnvironmentVariableSetup) MarshalJSON() ([]byte, error) { - evs.Type = TypeEnvironmentVariableSetup +// MarshalJSON is the custom marshaler for DataMaskingPolicyProperties. +func (dmpp DataMaskingPolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if evs.EnvironmentVariableSetupTypeProperties != nil { - objectMap["typeProperties"] = evs.EnvironmentVariableSetupTypeProperties + if dmpp.DataMaskingState != "" { + objectMap["dataMaskingState"] = dmpp.DataMaskingState } - if evs.Type != "" { - objectMap["type"] = evs.Type + if dmpp.ExemptPrincipals != nil { + objectMap["exemptPrincipals"] = dmpp.ExemptPrincipals } return json.Marshal(objectMap) } -// AsCmdkeySetup is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. -func (evs EnvironmentVariableSetup) AsCmdkeySetup() (*CmdkeySetup, bool) { - return nil, false -} - -// AsEnvironmentVariableSetup is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. -func (evs EnvironmentVariableSetup) AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) { - return &evs, true -} - -// AsComponentSetup is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. -func (evs EnvironmentVariableSetup) AsComponentSetup() (*ComponentSetup, bool) { - return nil, false -} - -// AsCustomSetupBase is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. -func (evs EnvironmentVariableSetup) AsCustomSetupBase() (*CustomSetupBase, bool) { - return nil, false +// DataMaskingRule represents a Sql pool data masking rule. +type DataMaskingRule struct { + autorest.Response `json:"-"` + // DataMaskingRuleProperties - The properties of the resource. + *DataMaskingRuleProperties `json:"properties,omitempty"` + // Location - READ-ONLY; The location of the data masking rule. + Location *string `json:"location,omitempty"` + // Kind - READ-ONLY; The kind of Data Masking Rule. Metadata, used for Azure portal. + Kind *string `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` } -// AsBasicCustomSetupBase is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. -func (evs EnvironmentVariableSetup) AsBasicCustomSetupBase() (BasicCustomSetupBase, bool) { - return &evs, true +// MarshalJSON is the custom marshaler for DataMaskingRule. +func (dmr DataMaskingRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dmr.DataMaskingRuleProperties != nil { + objectMap["properties"] = dmr.DataMaskingRuleProperties + } + return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for EnvironmentVariableSetup struct. -func (evs *EnvironmentVariableSetup) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for DataMaskingRule struct. +func (dmr *DataMaskingRule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1074,23 +1116,59 @@ func (evs *EnvironmentVariableSetup) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "typeProperties": + case "properties": if v != nil { - var environmentVariableSetupTypeProperties EnvironmentVariableSetupTypeProperties - err = json.Unmarshal(*v, &environmentVariableSetupTypeProperties) + var dataMaskingRuleProperties DataMaskingRuleProperties + err = json.Unmarshal(*v, &dataMaskingRuleProperties) if err != nil { return err } - evs.EnvironmentVariableSetupTypeProperties = &environmentVariableSetupTypeProperties + dmr.DataMaskingRuleProperties = &dataMaskingRuleProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dmr.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dmr.Kind = &kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dmr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dmr.Name = &name } case "type": if v != nil { - var typeVar TypeBasicCustomSetupBase + var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - evs.Type = typeVar + dmr.Type = &typeVar } } } @@ -1098,80 +1176,104 @@ func (evs *EnvironmentVariableSetup) UnmarshalJSON(body []byte) error { return nil } -// EnvironmentVariableSetupTypeProperties environment variable custom setup type properties. -type EnvironmentVariableSetupTypeProperties struct { - // VariableName - The name of the environment variable. - VariableName *string `json:"variableName,omitempty"` - // VariableValue - The value of the environment variable. - VariableValue *string `json:"variableValue,omitempty"` -} - -// ErrorAdditionalInfo the resource management error additional info. -type ErrorAdditionalInfo struct { - // Type - READ-ONLY; The additional info type. - Type *string `json:"type,omitempty"` - // Info - READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty"` -} - -// ErrorContract contains details when the response code indicates an error. -type ErrorContract struct { - // Error - The error details. - Error *ErrorResponse `json:"error,omitempty"` -} - -// ErrorDetail error details -type ErrorDetail struct { - // Message - Error message - Message *string `json:"message,omitempty"` - // Code - Error code - Code *string `json:"code,omitempty"` - // Target - Error target - Target *string `json:"target,omitempty"` +// DataMaskingRuleListResult the response to a list data masking rules request. +type DataMaskingRuleListResult struct { + autorest.Response `json:"-"` + // Value - The list of Sql pool data masking rules. + Value *[]DataMaskingRule `json:"value,omitempty"` } -// ErrorResponse the resource management error response. -type ErrorResponse struct { - // Code - READ-ONLY; The error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; The error message. - Message *string `json:"message,omitempty"` - // Target - READ-ONLY; The error target. - Target *string `json:"target,omitempty"` - // Details - READ-ONLY; The error details. - Details *[]ErrorResponse `json:"details,omitempty"` - // AdditionalInfo - READ-ONLY; The error additional info. - AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +// DataMaskingRuleProperties the properties of a Sql pool data masking rule. +type DataMaskingRuleProperties struct { + // ID - READ-ONLY; The rule Id. + ID *string `json:"id,omitempty"` + // AliasName - The alias name. This is a legacy parameter and is no longer used. + AliasName *string `json:"aliasName,omitempty"` + // RuleState - The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState. Possible values include: 'DataMaskingRuleStateDisabled', 'DataMaskingRuleStateEnabled' + RuleState DataMaskingRuleState `json:"ruleState,omitempty"` + // SchemaName - The schema name on which the data masking rule is applied. + SchemaName *string `json:"schemaName,omitempty"` + // TableName - The table name on which the data masking rule is applied. + TableName *string `json:"tableName,omitempty"` + // ColumnName - The column name on which the data masking rule is applied. + ColumnName *string `json:"columnName,omitempty"` + // MaskingFunction - The masking function that is used for the data masking rule. Possible values include: 'DataMaskingFunctionDefault', 'DataMaskingFunctionCCN', 'DataMaskingFunctionEmail', 'DataMaskingFunctionNumber', 'DataMaskingFunctionSSN', 'DataMaskingFunctionText' + MaskingFunction DataMaskingFunction `json:"maskingFunction,omitempty"` + // NumberFrom - The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored. + NumberFrom *string `json:"numberFrom,omitempty"` + // NumberTo - The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored. + NumberTo *string `json:"numberTo,omitempty"` + // PrefixSize - If maskingFunction is set to Text, the number of characters to show unmasked in the beginning of the string. Otherwise, this parameter will be ignored. + PrefixSize *string `json:"prefixSize,omitempty"` + // SuffixSize - If maskingFunction is set to Text, the number of characters to show unmasked at the end of the string. Otherwise, this parameter will be ignored. + SuffixSize *string `json:"suffixSize,omitempty"` + // ReplacementString - If maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter will be ignored. + ReplacementString *string `json:"replacementString,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataMaskingRuleProperties. +func (dmrp DataMaskingRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dmrp.AliasName != nil { + objectMap["aliasName"] = dmrp.AliasName + } + if dmrp.RuleState != "" { + objectMap["ruleState"] = dmrp.RuleState + } + if dmrp.SchemaName != nil { + objectMap["schemaName"] = dmrp.SchemaName + } + if dmrp.TableName != nil { + objectMap["tableName"] = dmrp.TableName + } + if dmrp.ColumnName != nil { + objectMap["columnName"] = dmrp.ColumnName + } + if dmrp.MaskingFunction != "" { + objectMap["maskingFunction"] = dmrp.MaskingFunction + } + if dmrp.NumberFrom != nil { + objectMap["numberFrom"] = dmrp.NumberFrom + } + if dmrp.NumberTo != nil { + objectMap["numberTo"] = dmrp.NumberTo + } + if dmrp.PrefixSize != nil { + objectMap["prefixSize"] = dmrp.PrefixSize + } + if dmrp.SuffixSize != nil { + objectMap["suffixSize"] = dmrp.SuffixSize + } + if dmrp.ReplacementString != nil { + objectMap["replacementString"] = dmrp.ReplacementString + } + return json.Marshal(objectMap) } -// GeoBackupPolicy a database geo backup policy. -type GeoBackupPolicy struct { +// DataWarehouseUserActivities user activities of a data warehouse +type DataWarehouseUserActivities struct { autorest.Response `json:"-"` - // GeoBackupPolicyProperties - The properties of the geo backup policy. - *GeoBackupPolicyProperties `json:"properties,omitempty"` - // Kind - READ-ONLY; Kind of geo backup policy. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Backup policy location. - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // DataWarehouseUserActivitiesProperties - Resource properties. + *DataWarehouseUserActivitiesProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for GeoBackupPolicy. -func (gbp GeoBackupPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DataWarehouseUserActivities. +func (dwua DataWarehouseUserActivities) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if gbp.GeoBackupPolicyProperties != nil { - objectMap["properties"] = gbp.GeoBackupPolicyProperties + if dwua.DataWarehouseUserActivitiesProperties != nil { + objectMap["properties"] = dwua.DataWarehouseUserActivitiesProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for GeoBackupPolicy struct. -func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for DataWarehouseUserActivities struct. +func (dwua *DataWarehouseUserActivities) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1181,30 +1283,12 @@ func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var geoBackupPolicyProperties GeoBackupPolicyProperties - err = json.Unmarshal(*v, &geoBackupPolicyProperties) - if err != nil { - return err - } - gbp.GeoBackupPolicyProperties = &geoBackupPolicyProperties - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - gbp.Kind = &kind - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var dataWarehouseUserActivitiesProperties DataWarehouseUserActivitiesProperties + err = json.Unmarshal(*v, &dataWarehouseUserActivitiesProperties) if err != nil { return err } - gbp.Location = &location + dwua.DataWarehouseUserActivitiesProperties = &dataWarehouseUserActivitiesProperties } case "id": if v != nil { @@ -1213,7 +1297,7 @@ func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - gbp.ID = &ID + dwua.ID = &ID } case "name": if v != nil { @@ -1222,7 +1306,7 @@ func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - gbp.Name = &name + dwua.Name = &name } case "type": if v != nil { @@ -1231,7 +1315,7 @@ func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - gbp.Type = &typeVar + dwua.Type = &typeVar } } } @@ -1239,224 +1323,59 @@ func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error { return nil } -// GeoBackupPolicyProperties the properties of the geo backup policy. -type GeoBackupPolicyProperties struct { - // State - The state of the geo backup policy. Possible values include: 'GeoBackupPolicyStateDisabled', 'GeoBackupPolicyStateEnabled' - State GeoBackupPolicyState `json:"state,omitempty"` - // StorageType - READ-ONLY; The storage type of the geo backup policy. - StorageType *string `json:"storageType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GeoBackupPolicyProperties. -func (gbpp GeoBackupPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gbpp.State != "" { - objectMap["state"] = gbpp.State - } - return json.Marshal(objectMap) -} - -// GetSsisObjectMetadataRequest the request payload of get SSIS object metadata. -type GetSsisObjectMetadataRequest struct { - // MetadataPath - Metadata path. - MetadataPath *string `json:"metadataPath,omitempty"` -} - -// BasicIntegrationRuntime azure Synapse nested object which serves as a compute resource for activities. -type BasicIntegrationRuntime interface { - AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) - AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) - AsIntegrationRuntime() (*IntegrationRuntime, bool) -} - -// IntegrationRuntime azure Synapse nested object which serves as a compute resource for activities. -type IntegrationRuntime struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // Description - Integration runtime description. - Description *string `json:"description,omitempty"` - // Type - Possible values include: 'TypeIntegrationRuntime', 'TypeManaged', 'TypeSelfHosted' - Type Type `json:"type,omitempty"` -} - -func unmarshalBasicIntegrationRuntime(body []byte) (BasicIntegrationRuntime, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["type"] { - case string(TypeManaged): - var mir ManagedIntegrationRuntime - err := json.Unmarshal(body, &mir) - return mir, err - case string(TypeSelfHosted): - var shir SelfHostedIntegrationRuntime - err := json.Unmarshal(body, &shir) - return shir, err - default: - var ir IntegrationRuntime - err := json.Unmarshal(body, &ir) - return ir, err - } +// DataWarehouseUserActivitiesProperties user activities of a data warehouse. This currently includes the +// count of running or suspended queries. For more information, please view the sys.dm_pdw_exec_requests +// dynamic management view (DMV). +type DataWarehouseUserActivitiesProperties struct { + // ActiveQueriesCount - READ-ONLY; Count of running and suspended queries. + ActiveQueriesCount *int32 `json:"activeQueriesCount,omitempty"` } -func unmarshalBasicIntegrationRuntimeArray(body []byte) ([]BasicIntegrationRuntime, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - irArray := make([]BasicIntegrationRuntime, len(rawMessages)) - for index, rawMessage := range rawMessages { - ir, err := unmarshalBasicIntegrationRuntime(*rawMessage) - if err != nil { - return nil, err - } - irArray[index] = ir - } - return irArray, nil +// EncryptionDetails details of the encryption associated with the workspace +type EncryptionDetails struct { + // DoubleEncryptionEnabled - READ-ONLY; Double Encryption enabled + DoubleEncryptionEnabled *bool `json:"doubleEncryptionEnabled,omitempty"` + // Cmk - Customer Managed Key Details + Cmk *CustomerManagedKeyDetails `json:"cmk,omitempty"` } -// MarshalJSON is the custom marshaler for IntegrationRuntime. -func (ir IntegrationRuntime) MarshalJSON() ([]byte, error) { - ir.Type = TypeIntegrationRuntime +// MarshalJSON is the custom marshaler for EncryptionDetails. +func (ed EncryptionDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ir.Description != nil { - objectMap["description"] = ir.Description - } - if ir.Type != "" { - objectMap["type"] = ir.Type - } - for k, v := range ir.AdditionalProperties { - objectMap[k] = v + if ed.Cmk != nil { + objectMap["cmk"] = ed.Cmk } return json.Marshal(objectMap) } -// AsManagedIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime. -func (ir IntegrationRuntime) AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) { - return nil, false -} - -// AsSelfHostedIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime. -func (ir IntegrationRuntime) AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) { - return nil, false -} - -// AsIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime. -func (ir IntegrationRuntime) AsIntegrationRuntime() (*IntegrationRuntime, bool) { - return &ir, true -} - -// AsBasicIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime. -func (ir IntegrationRuntime) AsBasicIntegrationRuntime() (BasicIntegrationRuntime, bool) { - return &ir, true -} - -// UnmarshalJSON is the custom unmarshaler for IntegrationRuntime struct. -func (ir *IntegrationRuntime) 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 { - default: - if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) - if err != nil { - return err - } - if ir.AdditionalProperties == nil { - ir.AdditionalProperties = make(map[string]interface{}) - } - ir.AdditionalProperties[k] = additionalProperties - } - case "description": - if v != nil { - var description string - err = json.Unmarshal(*v, &description) - if err != nil { - return err - } - ir.Description = &description - } - case "type": - if v != nil { - var typeVar Type - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ir.Type = typeVar - } - } - } - - return nil -} - -// IntegrationRuntimeAuthKeys the integration runtime authentication keys. -type IntegrationRuntimeAuthKeys struct { +// EncryptionProtector the server encryption protector. +type EncryptionProtector struct { autorest.Response `json:"-"` - // AuthKey1 - The primary integration runtime authentication key. - AuthKey1 *string `json:"authKey1,omitempty"` - // AuthKey2 - The secondary integration runtime authentication key. - AuthKey2 *string `json:"authKey2,omitempty"` -} - -// IntegrationRuntimeComputeProperties the compute resource properties for managed integration runtime. -type IntegrationRuntimeComputeProperties struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // Location - The location for managed integration runtime. The supported regions could be found on https://docs.microsoft.com/en-us/azure/data-factory/data-factory-data-movement-activities + // Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience. + Kind *string `json:"kind,omitempty"` + // Location - READ-ONLY; Resource location. Location *string `json:"location,omitempty"` - // NodeSize - The node size requirement to managed integration runtime. - NodeSize *string `json:"nodeSize,omitempty"` - // NumberOfNodes - The required number of nodes for managed integration runtime. - NumberOfNodes *int32 `json:"numberOfNodes,omitempty"` - // MaxParallelExecutionsPerNode - Maximum parallel executions count per node for managed integration runtime. - MaxParallelExecutionsPerNode *int32 `json:"maxParallelExecutionsPerNode,omitempty"` - // DataFlowProperties - Data flow properties for managed integration runtime. - DataFlowProperties *IntegrationRuntimeDataFlowProperties `json:"dataFlowProperties,omitempty"` - // VNetProperties - VNet properties for managed integration runtime. - VNetProperties *IntegrationRuntimeVNetProperties `json:"vNetProperties,omitempty"` + // EncryptionProtectorProperties - Resource properties. + *EncryptionProtectorProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for IntegrationRuntimeComputeProperties. -func (ircp IntegrationRuntimeComputeProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for EncryptionProtector. +func (ep EncryptionProtector) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ircp.Location != nil { - objectMap["location"] = ircp.Location - } - if ircp.NodeSize != nil { - objectMap["nodeSize"] = ircp.NodeSize - } - if ircp.NumberOfNodes != nil { - objectMap["numberOfNodes"] = ircp.NumberOfNodes - } - if ircp.MaxParallelExecutionsPerNode != nil { - objectMap["maxParallelExecutionsPerNode"] = ircp.MaxParallelExecutionsPerNode - } - if ircp.DataFlowProperties != nil { - objectMap["dataFlowProperties"] = ircp.DataFlowProperties - } - if ircp.VNetProperties != nil { - objectMap["vNetProperties"] = ircp.VNetProperties - } - for k, v := range ircp.AdditionalProperties { - objectMap[k] = v + if ep.EncryptionProtectorProperties != nil { + objectMap["properties"] = ep.EncryptionProtectorProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeComputeProperties struct. -func (ircp *IntegrationRuntimeComputeProperties) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for EncryptionProtector struct. +func (ep *EncryptionProtector) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1464,17 +1383,14 @@ func (ircp *IntegrationRuntimeComputeProperties) UnmarshalJSON(body []byte) erro } for k, v := range m { switch k { - default: + case "kind": if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) + var kind string + err = json.Unmarshal(*v, &kind) if err != nil { return err } - if ircp.AdditionalProperties == nil { - ircp.AdditionalProperties = make(map[string]interface{}) - } - ircp.AdditionalProperties[k] = additionalProperties + ep.Kind = &kind } case "location": if v != nil { @@ -1483,52 +1399,43 @@ func (ircp *IntegrationRuntimeComputeProperties) UnmarshalJSON(body []byte) erro if err != nil { return err } - ircp.Location = &location - } - case "nodeSize": - if v != nil { - var nodeSize string - err = json.Unmarshal(*v, &nodeSize) - if err != nil { - return err - } - ircp.NodeSize = &nodeSize + ep.Location = &location } - case "numberOfNodes": + case "properties": if v != nil { - var numberOfNodes int32 - err = json.Unmarshal(*v, &numberOfNodes) + var encryptionProtectorProperties EncryptionProtectorProperties + err = json.Unmarshal(*v, &encryptionProtectorProperties) if err != nil { return err } - ircp.NumberOfNodes = &numberOfNodes + ep.EncryptionProtectorProperties = &encryptionProtectorProperties } - case "maxParallelExecutionsPerNode": + case "id": if v != nil { - var maxParallelExecutionsPerNode int32 - err = json.Unmarshal(*v, &maxParallelExecutionsPerNode) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - ircp.MaxParallelExecutionsPerNode = &maxParallelExecutionsPerNode + ep.ID = &ID } - case "dataFlowProperties": + case "name": if v != nil { - var dataFlowProperties IntegrationRuntimeDataFlowProperties - err = json.Unmarshal(*v, &dataFlowProperties) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - ircp.DataFlowProperties = &dataFlowProperties + ep.Name = &name } - case "vNetProperties": + case "type": if v != nil { - var vNetProperties IntegrationRuntimeVNetProperties - err = json.Unmarshal(*v, &vNetProperties) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - ircp.VNetProperties = &vNetProperties + ep.Type = &typeVar } } } @@ -1536,240 +1443,27 @@ func (ircp *IntegrationRuntimeComputeProperties) UnmarshalJSON(body []byte) erro return nil } -// IntegrationRuntimeConnectionInfo connection information for encrypting the on-premises data source -// credentials. -type IntegrationRuntimeConnectionInfo struct { - autorest.Response `json:"-"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // ServiceToken - READ-ONLY; The token generated in service. Callers use this token to authenticate to integration runtime. - ServiceToken *string `json:"serviceToken,omitempty"` - // IdentityCertThumbprint - READ-ONLY; The integration runtime SSL certificate thumbprint. Click-Once application uses it to do server validation. - IdentityCertThumbprint *string `json:"identityCertThumbprint,omitempty"` - // HostServiceURI - READ-ONLY; The on-premises integration runtime host URL. - HostServiceURI *string `json:"hostServiceUri,omitempty"` - // Version - READ-ONLY; The integration runtime version. - Version *string `json:"version,omitempty"` - // PublicKey - READ-ONLY; The public key for encrypting a credential when transferring the credential to the integration runtime. - PublicKey *string `json:"publicKey,omitempty"` - // IsIdentityCertExprired - READ-ONLY; Whether the identity certificate is expired. - IsIdentityCertExprired *bool `json:"isIdentityCertExprired,omitempty"` -} - -// MarshalJSON is the custom marshaler for IntegrationRuntimeConnectionInfo. -func (irci IntegrationRuntimeConnectionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - for k, v := range irci.AdditionalProperties { - objectMap[k] = v - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeConnectionInfo struct. -func (irci *IntegrationRuntimeConnectionInfo) 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 { - default: - if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) - if err != nil { - return err - } - if irci.AdditionalProperties == nil { - irci.AdditionalProperties = make(map[string]interface{}) - } - irci.AdditionalProperties[k] = additionalProperties - } - case "serviceToken": - if v != nil { - var serviceToken string - err = json.Unmarshal(*v, &serviceToken) - if err != nil { - return err - } - irci.ServiceToken = &serviceToken - } - case "identityCertThumbprint": - if v != nil { - var identityCertThumbprint string - err = json.Unmarshal(*v, &identityCertThumbprint) - if err != nil { - return err - } - irci.IdentityCertThumbprint = &identityCertThumbprint - } - case "hostServiceUri": - if v != nil { - var hostServiceURI string - err = json.Unmarshal(*v, &hostServiceURI) - if err != nil { - return err - } - irci.HostServiceURI = &hostServiceURI - } - case "version": - if v != nil { - var version string - err = json.Unmarshal(*v, &version) - if err != nil { - return err - } - irci.Version = &version - } - case "publicKey": - if v != nil { - var publicKey string - err = json.Unmarshal(*v, &publicKey) - if err != nil { - return err - } - irci.PublicKey = &publicKey - } - case "isIdentityCertExprired": - if v != nil { - var isIdentityCertExprired bool - err = json.Unmarshal(*v, &isIdentityCertExprired) - if err != nil { - return err - } - irci.IsIdentityCertExprired = &isIdentityCertExprired - } - } - } - - return nil -} - -// IntegrationRuntimeCustomSetupScriptProperties custom setup script properties for a managed dedicated -// integration runtime. -type IntegrationRuntimeCustomSetupScriptProperties struct { - // BlobContainerURI - The URI of the Azure blob container that contains the custom setup script. - BlobContainerURI *string `json:"blobContainerUri,omitempty"` - // SasToken - The SAS token of the Azure blob container. - SasToken *SecureString `json:"sasToken,omitempty"` -} - -// IntegrationRuntimeDataFlowProperties data flow properties for managed integration runtime. -type IntegrationRuntimeDataFlowProperties struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // ComputeType - Compute type of the cluster which will execute data flow job. Possible values include: 'General', 'MemoryOptimized', 'ComputeOptimized' - ComputeType DataFlowComputeType `json:"computeType,omitempty"` - // CoreCount - Core count of the cluster which will execute data flow job. Supported values are: 8, 16, 32, 48, 80, 144 and 272. - CoreCount *int32 `json:"coreCount,omitempty"` - // TimeToLive - Time to live (in minutes) setting of the cluster which will execute data flow job. - TimeToLive *int32 `json:"timeToLive,omitempty"` -} - -// MarshalJSON is the custom marshaler for IntegrationRuntimeDataFlowProperties. -func (irdfp IntegrationRuntimeDataFlowProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if irdfp.ComputeType != "" { - objectMap["computeType"] = irdfp.ComputeType - } - if irdfp.CoreCount != nil { - objectMap["coreCount"] = irdfp.CoreCount - } - if irdfp.TimeToLive != nil { - objectMap["timeToLive"] = irdfp.TimeToLive - } - for k, v := range irdfp.AdditionalProperties { - objectMap[k] = v - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeDataFlowProperties struct. -func (irdfp *IntegrationRuntimeDataFlowProperties) 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 { - default: - if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) - if err != nil { - return err - } - if irdfp.AdditionalProperties == nil { - irdfp.AdditionalProperties = make(map[string]interface{}) - } - irdfp.AdditionalProperties[k] = additionalProperties - } - case "computeType": - if v != nil { - var computeType DataFlowComputeType - err = json.Unmarshal(*v, &computeType) - if err != nil { - return err - } - irdfp.ComputeType = computeType - } - case "coreCount": - if v != nil { - var coreCount int32 - err = json.Unmarshal(*v, &coreCount) - if err != nil { - return err - } - irdfp.CoreCount = &coreCount - } - case "timeToLive": - if v != nil { - var timeToLive int32 - err = json.Unmarshal(*v, &timeToLive) - if err != nil { - return err - } - irdfp.TimeToLive = &timeToLive - } - } - } - - return nil -} - -// IntegrationRuntimeDataProxyProperties data proxy properties for a managed dedicated integration runtime. -type IntegrationRuntimeDataProxyProperties struct { - // ConnectVia - The self-hosted integration runtime reference. - ConnectVia *EntityReference `json:"connectVia,omitempty"` - // StagingLinkedService - The staging linked service reference. - StagingLinkedService *EntityReference `json:"stagingLinkedService,omitempty"` - // Path - The path to contain the staged data in the Blob storage. - Path *string `json:"path,omitempty"` -} - -// IntegrationRuntimeListResponse a list of integration runtime resources. -type IntegrationRuntimeListResponse struct { +// EncryptionProtectorListResult a list of server encryption protectors. +type EncryptionProtectorListResult struct { autorest.Response `json:"-"` - // Value - List of integration runtimes. - Value *[]IntegrationRuntimeResource `json:"value,omitempty"` - // NextLink - The link to the next page of results, if any remaining results exist. + // Value - READ-ONLY; Array of results. + Value *[]EncryptionProtector `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } -// IntegrationRuntimeListResponseIterator provides access to a complete listing of IntegrationRuntimeResource +// EncryptionProtectorListResultIterator provides access to a complete listing of EncryptionProtector // values. -type IntegrationRuntimeListResponseIterator struct { +type EncryptionProtectorListResultIterator struct { i int - page IntegrationRuntimeListResponsePage + page EncryptionProtectorListResultPage } // 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 *IntegrationRuntimeListResponseIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *EncryptionProtectorListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeListResponseIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -1794,67 +1488,67 @@ func (iter *IntegrationRuntimeListResponseIterator) NextWithContext(ctx context. // 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 *IntegrationRuntimeListResponseIterator) Next() error { +func (iter *EncryptionProtectorListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IntegrationRuntimeListResponseIterator) NotDone() bool { +func (iter EncryptionProtectorListResultIterator) 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 IntegrationRuntimeListResponseIterator) Response() IntegrationRuntimeListResponse { +func (iter EncryptionProtectorListResultIterator) Response() EncryptionProtectorListResult { 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 IntegrationRuntimeListResponseIterator) Value() IntegrationRuntimeResource { +func (iter EncryptionProtectorListResultIterator) Value() EncryptionProtector { if !iter.page.NotDone() { - return IntegrationRuntimeResource{} + return EncryptionProtector{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the IntegrationRuntimeListResponseIterator type. -func NewIntegrationRuntimeListResponseIterator(page IntegrationRuntimeListResponsePage) IntegrationRuntimeListResponseIterator { - return IntegrationRuntimeListResponseIterator{page: page} +// Creates a new instance of the EncryptionProtectorListResultIterator type. +func NewEncryptionProtectorListResultIterator(page EncryptionProtectorListResultPage) EncryptionProtectorListResultIterator { + return EncryptionProtectorListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (irlr IntegrationRuntimeListResponse) IsEmpty() bool { - return irlr.Value == nil || len(*irlr.Value) == 0 +func (eplr EncryptionProtectorListResult) IsEmpty() bool { + return eplr.Value == nil || len(*eplr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (irlr IntegrationRuntimeListResponse) hasNextLink() bool { - return irlr.NextLink != nil && len(*irlr.NextLink) != 0 +func (eplr EncryptionProtectorListResult) hasNextLink() bool { + return eplr.NextLink != nil && len(*eplr.NextLink) != 0 } -// integrationRuntimeListResponsePreparer prepares a request to retrieve the next set of results. +// encryptionProtectorListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (irlr IntegrationRuntimeListResponse) integrationRuntimeListResponsePreparer(ctx context.Context) (*http.Request, error) { - if !irlr.hasNextLink() { +func (eplr EncryptionProtectorListResult) encryptionProtectorListResultPreparer(ctx context.Context) (*http.Request, error) { + if !eplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(irlr.NextLink))) + autorest.WithBaseURL(to.String(eplr.NextLink))) } -// IntegrationRuntimeListResponsePage contains a page of IntegrationRuntimeResource values. -type IntegrationRuntimeListResponsePage struct { - fn func(context.Context, IntegrationRuntimeListResponse) (IntegrationRuntimeListResponse, error) - irlr IntegrationRuntimeListResponse +// EncryptionProtectorListResultPage contains a page of EncryptionProtector values. +type EncryptionProtectorListResultPage struct { + fn func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error) + eplr EncryptionProtectorListResult } // 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 *IntegrationRuntimeListResponsePage) NextWithContext(ctx context.Context) (err error) { +func (page *EncryptionProtectorListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeListResponsePage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -1864,11 +1558,11 @@ func (page *IntegrationRuntimeListResponsePage) NextWithContext(ctx context.Cont }() } for { - next, err := page.fn(ctx, page.irlr) + next, err := page.fn(ctx, page.eplr) if err != nil { return err } - page.irlr = next + page.eplr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -1879,82 +1573,118 @@ func (page *IntegrationRuntimeListResponsePage) NextWithContext(ctx context.Cont // 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 *IntegrationRuntimeListResponsePage) Next() error { +func (page *EncryptionProtectorListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IntegrationRuntimeListResponsePage) NotDone() bool { - return !page.irlr.IsEmpty() +func (page EncryptionProtectorListResultPage) NotDone() bool { + return !page.eplr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page IntegrationRuntimeListResponsePage) Response() IntegrationRuntimeListResponse { - return page.irlr +func (page EncryptionProtectorListResultPage) Response() EncryptionProtectorListResult { + return page.eplr } // Values returns the slice of values for the current page or nil if there are no values. -func (page IntegrationRuntimeListResponsePage) Values() []IntegrationRuntimeResource { - if page.irlr.IsEmpty() { +func (page EncryptionProtectorListResultPage) Values() []EncryptionProtector { + if page.eplr.IsEmpty() { return nil } - return *page.irlr.Value + return *page.eplr.Value } -// Creates a new instance of the IntegrationRuntimeListResponsePage type. -func NewIntegrationRuntimeListResponsePage(getNextPage func(context.Context, IntegrationRuntimeListResponse) (IntegrationRuntimeListResponse, error)) IntegrationRuntimeListResponsePage { - return IntegrationRuntimeListResponsePage{fn: getNextPage} +// Creates a new instance of the EncryptionProtectorListResultPage type. +func NewEncryptionProtectorListResultPage(cur EncryptionProtectorListResult, getNextPage func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error)) EncryptionProtectorListResultPage { + return EncryptionProtectorListResultPage{ + fn: getNextPage, + eplr: cur, + } } -// IntegrationRuntimeMonitoringData get monitoring data response. -type IntegrationRuntimeMonitoringData struct { - autorest.Response `json:"-"` - // Name - Integration runtime name. - Name *string `json:"name,omitempty"` - // Nodes - Integration runtime node monitoring data. - Nodes *[]IntegrationRuntimeNodeMonitoringData `json:"nodes,omitempty"` +// EncryptionProtectorProperties properties for an encryption protector execution. +type EncryptionProtectorProperties struct { + // Subregion - READ-ONLY; Subregion of the encryption protector. + Subregion *string `json:"subregion,omitempty"` + // ServerKeyName - The name of the server key. + ServerKeyName *string `json:"serverKeyName,omitempty"` + // ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault' + ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"` + // URI - READ-ONLY; The URI of the server key. + URI *string `json:"uri,omitempty"` + // Thumbprint - READ-ONLY; Thumbprint of the server key. + Thumbprint *string `json:"thumbprint,omitempty"` } -// IntegrationRuntimeNodeIPAddress the IP address of self-hosted integration runtime node. -type IntegrationRuntimeNodeIPAddress struct { - autorest.Response `json:"-"` - // IPAddress - READ-ONLY; The IP address of self-hosted integration runtime node. - IPAddress *string `json:"ipAddress,omitempty"` +// MarshalJSON is the custom marshaler for EncryptionProtectorProperties. +func (epp EncryptionProtectorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if epp.ServerKeyName != nil { + objectMap["serverKeyName"] = epp.ServerKeyName + } + if epp.ServerKeyType != "" { + objectMap["serverKeyType"] = epp.ServerKeyType + } + return json.Marshal(objectMap) } -// IntegrationRuntimeNodeMonitoringData monitoring data for integration runtime node. -type IntegrationRuntimeNodeMonitoringData struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // NodeName - READ-ONLY; Name of the integration runtime node. - NodeName *string `json:"nodeName,omitempty"` - // AvailableMemoryInMB - READ-ONLY; Available memory (MB) on the integration runtime node. - AvailableMemoryInMB *int32 `json:"availableMemoryInMB,omitempty"` - // CPUUtilization - READ-ONLY; CPU percentage on the integration runtime node. - CPUUtilization *int32 `json:"cpuUtilization,omitempty"` - // ConcurrentJobsLimit - READ-ONLY; Maximum concurrent jobs on the integration runtime node. - ConcurrentJobsLimit *int32 `json:"concurrentJobsLimit,omitempty"` - // ConcurrentJobsRunning - READ-ONLY; The number of jobs currently running on the integration runtime node. - ConcurrentJobsRunning *int32 `json:"concurrentJobsRunning,omitempty"` - // MaxConcurrentJobs - READ-ONLY; The maximum concurrent jobs in this integration runtime. - MaxConcurrentJobs *int32 `json:"maxConcurrentJobs,omitempty"` - // SentBytes - READ-ONLY; Sent bytes on the integration runtime node. - SentBytes *float64 `json:"sentBytes,omitempty"` - // ReceivedBytes - READ-ONLY; Received bytes on the integration runtime node. - ReceivedBytes *float64 `json:"receivedBytes,omitempty"` +// EntityReference the entity reference. +type EntityReference struct { + // Type - The type of this referenced entity. Possible values include: 'IntegrationRuntimeReference', 'LinkedServiceReference' + Type IntegrationRuntimeEntityReferenceType `json:"type,omitempty"` + // ReferenceName - The name of this referenced entity. + ReferenceName *string `json:"referenceName,omitempty"` } -// MarshalJSON is the custom marshaler for IntegrationRuntimeNodeMonitoringData. -func (irnmd IntegrationRuntimeNodeMonitoringData) MarshalJSON() ([]byte, error) { +// EnvironmentVariableSetup the custom setup of setting environment variable. +type EnvironmentVariableSetup struct { + // EnvironmentVariableSetupTypeProperties - Add environment variable type properties. + *EnvironmentVariableSetupTypeProperties `json:"typeProperties,omitempty"` + // Type - Possible values include: 'TypeCustomSetupBase', 'TypeCmdkeySetup', 'TypeEnvironmentVariableSetup', 'TypeComponentSetup' + Type TypeBasicCustomSetupBase `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EnvironmentVariableSetup. +func (evs EnvironmentVariableSetup) MarshalJSON() ([]byte, error) { + evs.Type = TypeEnvironmentVariableSetup objectMap := make(map[string]interface{}) - for k, v := range irnmd.AdditionalProperties { - objectMap[k] = v + if evs.EnvironmentVariableSetupTypeProperties != nil { + objectMap["typeProperties"] = evs.EnvironmentVariableSetupTypeProperties + } + if evs.Type != "" { + objectMap["type"] = evs.Type } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeNodeMonitoringData struct. -func (irnmd *IntegrationRuntimeNodeMonitoringData) UnmarshalJSON(body []byte) error { +// AsCmdkeySetup is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. +func (evs EnvironmentVariableSetup) AsCmdkeySetup() (*CmdkeySetup, bool) { + return nil, false +} + +// AsEnvironmentVariableSetup is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. +func (evs EnvironmentVariableSetup) AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) { + return &evs, true +} + +// AsComponentSetup is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. +func (evs EnvironmentVariableSetup) AsComponentSetup() (*ComponentSetup, bool) { + return nil, false +} + +// AsCustomSetupBase is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. +func (evs EnvironmentVariableSetup) AsCustomSetupBase() (*CustomSetupBase, bool) { + return nil, false +} + +// AsBasicCustomSetupBase is the BasicCustomSetupBase implementation for EnvironmentVariableSetup. +func (evs EnvironmentVariableSetup) AsBasicCustomSetupBase() (BasicCustomSetupBase, bool) { + return &evs, true +} + +// UnmarshalJSON is the custom unmarshaler for EnvironmentVariableSetup struct. +func (evs *EnvironmentVariableSetup) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1962,89 +1692,23 @@ func (irnmd *IntegrationRuntimeNodeMonitoringData) UnmarshalJSON(body []byte) er } for k, v := range m { switch k { - default: - if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) - if err != nil { - return err - } - if irnmd.AdditionalProperties == nil { - irnmd.AdditionalProperties = make(map[string]interface{}) - } - irnmd.AdditionalProperties[k] = additionalProperties - } - case "nodeName": - if v != nil { - var nodeName string - err = json.Unmarshal(*v, &nodeName) - if err != nil { - return err - } - irnmd.NodeName = &nodeName - } - case "availableMemoryInMB": - if v != nil { - var availableMemoryInMB int32 - err = json.Unmarshal(*v, &availableMemoryInMB) - if err != nil { - return err - } - irnmd.AvailableMemoryInMB = &availableMemoryInMB - } - case "cpuUtilization": - if v != nil { - var CPUUtilization int32 - err = json.Unmarshal(*v, &CPUUtilization) - if err != nil { - return err - } - irnmd.CPUUtilization = &CPUUtilization - } - case "concurrentJobsLimit": - if v != nil { - var concurrentJobsLimit int32 - err = json.Unmarshal(*v, &concurrentJobsLimit) - if err != nil { - return err - } - irnmd.ConcurrentJobsLimit = &concurrentJobsLimit - } - case "concurrentJobsRunning": - if v != nil { - var concurrentJobsRunning int32 - err = json.Unmarshal(*v, &concurrentJobsRunning) - if err != nil { - return err - } - irnmd.ConcurrentJobsRunning = &concurrentJobsRunning - } - case "maxConcurrentJobs": - if v != nil { - var maxConcurrentJobs int32 - err = json.Unmarshal(*v, &maxConcurrentJobs) - if err != nil { - return err - } - irnmd.MaxConcurrentJobs = &maxConcurrentJobs - } - case "sentBytes": + case "typeProperties": if v != nil { - var sentBytes float64 - err = json.Unmarshal(*v, &sentBytes) + var environmentVariableSetupTypeProperties EnvironmentVariableSetupTypeProperties + err = json.Unmarshal(*v, &environmentVariableSetupTypeProperties) if err != nil { return err } - irnmd.SentBytes = &sentBytes + evs.EnvironmentVariableSetupTypeProperties = &environmentVariableSetupTypeProperties } - case "receivedBytes": + case "type": if v != nil { - var receivedBytes float64 - err = json.Unmarshal(*v, &receivedBytes) + var typeVar TypeBasicCustomSetupBase + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - irnmd.ReceivedBytes = &receivedBytes + evs.Type = typeVar } } } @@ -2052,36 +1716,77 @@ func (irnmd *IntegrationRuntimeNodeMonitoringData) UnmarshalJSON(body []byte) er return nil } -// IntegrationRuntimeRegenerateKeyParameters parameters to regenerate the authentication key. -type IntegrationRuntimeRegenerateKeyParameters struct { - // KeyName - The name of the authentication key to regenerate. Possible values include: 'AuthKey1', 'AuthKey2' - KeyName IntegrationRuntimeAuthKeyName `json:"keyName,omitempty"` +// EnvironmentVariableSetupTypeProperties environment variable custom setup type properties. +type EnvironmentVariableSetupTypeProperties struct { + // VariableName - The name of the environment variable. + VariableName *string `json:"variableName,omitempty"` + // VariableValue - The value of the environment variable. + VariableValue *string `json:"variableValue,omitempty"` } -// IntegrationRuntimeResource integration runtime resource type. -type IntegrationRuntimeResource struct { +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` +} + +// ErrorContract contains details when the response code indicates an error. +type ErrorContract struct { + // Error - The error details. + Error *ErrorResponse `json:"error,omitempty"` +} + +// ErrorDetail error details +type ErrorDetail struct { + // Message - Error message + Message *string `json:"message,omitempty"` + // Code - Error code + Code *string `json:"code,omitempty"` + // Target - Error target + Target *string `json:"target,omitempty"` +} + +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.) +type ErrorResponse struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]ErrorResponse `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// ExtendedServerBlobAuditingPolicy an extended server blob auditing policy. +type ExtendedServerBlobAuditingPolicy struct { autorest.Response `json:"-"` - // Properties - Integration runtime properties. - Properties BasicIntegrationRuntime `json:"properties,omitempty"` - // Etag - READ-ONLY; Resource Etag. - Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ExtendedServerBlobAuditingPolicyProperties - Resource properties. + *ExtendedServerBlobAuditingPolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for IntegrationRuntimeResource. -func (irr IntegrationRuntimeResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ExtendedServerBlobAuditingPolicy. +func (esbap ExtendedServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = irr.Properties + if esbap.ExtendedServerBlobAuditingPolicyProperties != nil { + objectMap["properties"] = esbap.ExtendedServerBlobAuditingPolicyProperties + } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeResource struct. -func (irr *IntegrationRuntimeResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ExtendedServerBlobAuditingPolicy struct. +func (esbap *ExtendedServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -2091,20 +1796,12 @@ func (irr *IntegrationRuntimeResource) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - properties, err := unmarshalBasicIntegrationRuntime(*v) - if err != nil { - return err - } - irr.Properties = properties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) + var extendedServerBlobAuditingPolicyProperties ExtendedServerBlobAuditingPolicyProperties + err = json.Unmarshal(*v, &extendedServerBlobAuditingPolicyProperties) if err != nil { return err } - irr.Etag = &etag + esbap.ExtendedServerBlobAuditingPolicyProperties = &extendedServerBlobAuditingPolicyProperties } case "id": if v != nil { @@ -2113,7 +1810,7 @@ func (irr *IntegrationRuntimeResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - irr.ID = &ID + esbap.ID = &ID } case "name": if v != nil { @@ -2122,7 +1819,7 @@ func (irr *IntegrationRuntimeResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - irr.Name = &name + esbap.Name = &name } case "type": if v != nil { @@ -2131,7 +1828,7 @@ func (irr *IntegrationRuntimeResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - irr.Type = &typeVar + esbap.Type = &typeVar } } } @@ -2139,95 +1836,287 @@ func (irr *IntegrationRuntimeResource) UnmarshalJSON(body []byte) error { return nil } -// IntegrationRuntimesCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type IntegrationRuntimesCreateFuture struct { - azure.Future +// ExtendedServerBlobAuditingPolicyListResult a list of server extended auditing settings. +type ExtendedServerBlobAuditingPolicyListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]ExtendedServerBlobAuditingPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *IntegrationRuntimesCreateFuture) Result(client IntegrationRuntimesClient) (irr IntegrationRuntimeResource, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesCreateFuture", "Result", future.Response(), "Polling failure") - return +// ExtendedServerBlobAuditingPolicyListResultIterator provides access to a complete listing of +// ExtendedServerBlobAuditingPolicy values. +type ExtendedServerBlobAuditingPolicyListResultIterator struct { + i int + page ExtendedServerBlobAuditingPolicyListResultPage +} + +// 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 *ExtendedServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if !done { - err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimesCreateFuture") - return + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if irr.Response.Response, err = future.GetResult(sender); err == nil && irr.Response.Response.StatusCode != http.StatusNoContent { - irr, err = client.CreateResponder(irr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesCreateFuture", "Result", irr.Response.Response, "Failure responding to request") - } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err } - return + iter.i = 0 + return nil } -// IntegrationRuntimesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type IntegrationRuntimesDeleteFuture struct { - azure.Future +// 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 *ExtendedServerBlobAuditingPolicyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *IntegrationRuntimesDeleteFuture) Result(client IntegrationRuntimesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesDeleteFuture", "Result", future.Response(), "Polling failure") - return +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExtendedServerBlobAuditingPolicyListResultIterator) 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 ExtendedServerBlobAuditingPolicyListResultIterator) Response() ExtendedServerBlobAuditingPolicyListResult { + 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 ExtendedServerBlobAuditingPolicyListResultIterator) Value() ExtendedServerBlobAuditingPolicy { + if !iter.page.NotDone() { + return ExtendedServerBlobAuditingPolicy{} } - if !done { - err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimesDeleteFuture") - return + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultIterator type. +func NewExtendedServerBlobAuditingPolicyListResultIterator(page ExtendedServerBlobAuditingPolicyListResultPage) ExtendedServerBlobAuditingPolicyListResultIterator { + return ExtendedServerBlobAuditingPolicyListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (esbaplr ExtendedServerBlobAuditingPolicyListResult) IsEmpty() bool { + return esbaplr.Value == nil || len(*esbaplr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (esbaplr ExtendedServerBlobAuditingPolicyListResult) hasNextLink() bool { + return esbaplr.NextLink != nil && len(*esbaplr.NextLink) != 0 +} + +// extendedServerBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (esbaplr ExtendedServerBlobAuditingPolicyListResult) extendedServerBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if !esbaplr.hasNextLink() { + return nil, nil } - ar.Response = future.Response() - return + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(esbaplr.NextLink))) } -// IntegrationRuntimeSsisCatalogInfo catalog information for managed dedicated integration runtime. -type IntegrationRuntimeSsisCatalogInfo struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // CatalogServerEndpoint - The catalog database server URL. - CatalogServerEndpoint *string `json:"catalogServerEndpoint,omitempty"` - // CatalogAdminUserName - The administrator user name of catalog database. - CatalogAdminUserName *string `json:"catalogAdminUserName,omitempty"` - // CatalogAdminPassword - The password of the administrator user account of the catalog database. - CatalogAdminPassword *SecureString `json:"catalogAdminPassword,omitempty"` - // CatalogPricingTier - The pricing tier for the catalog database. The valid values could be found in https://azure.microsoft.com/en-us/pricing/details/sql-database/. Possible values include: 'IntegrationRuntimeSsisCatalogPricingTierBasic', 'IntegrationRuntimeSsisCatalogPricingTierStandard', 'IntegrationRuntimeSsisCatalogPricingTierPremium', 'IntegrationRuntimeSsisCatalogPricingTierPremiumRS' - CatalogPricingTier IntegrationRuntimeSsisCatalogPricingTier `json:"catalogPricingTier,omitempty"` +// ExtendedServerBlobAuditingPolicyListResultPage contains a page of ExtendedServerBlobAuditingPolicy +// values. +type ExtendedServerBlobAuditingPolicyListResultPage struct { + fn func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error) + esbaplr ExtendedServerBlobAuditingPolicyListResult } -// MarshalJSON is the custom marshaler for IntegrationRuntimeSsisCatalogInfo. -func (irsci IntegrationRuntimeSsisCatalogInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if irsci.CatalogServerEndpoint != nil { - objectMap["catalogServerEndpoint"] = irsci.CatalogServerEndpoint +// 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 *ExtendedServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if irsci.CatalogAdminUserName != nil { - objectMap["catalogAdminUserName"] = irsci.CatalogAdminUserName + for { + next, err := page.fn(ctx, page.esbaplr) + if err != nil { + return err + } + page.esbaplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - if irsci.CatalogAdminPassword != nil { - objectMap["catalogAdminPassword"] = irsci.CatalogAdminPassword + 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 *ExtendedServerBlobAuditingPolicyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExtendedServerBlobAuditingPolicyListResultPage) NotDone() bool { + return !page.esbaplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExtendedServerBlobAuditingPolicyListResultPage) Response() ExtendedServerBlobAuditingPolicyListResult { + return page.esbaplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExtendedServerBlobAuditingPolicyListResultPage) Values() []ExtendedServerBlobAuditingPolicy { + if page.esbaplr.IsEmpty() { + return nil } - if irsci.CatalogPricingTier != "" { - objectMap["catalogPricingTier"] = irsci.CatalogPricingTier + return *page.esbaplr.Value +} + +// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultPage type. +func NewExtendedServerBlobAuditingPolicyListResultPage(cur ExtendedServerBlobAuditingPolicyListResult, getNextPage func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error)) ExtendedServerBlobAuditingPolicyListResultPage { + return ExtendedServerBlobAuditingPolicyListResultPage{ + fn: getNextPage, + esbaplr: cur, } - for k, v := range irsci.AdditionalProperties { - objectMap[k] = v +} + +// ExtendedServerBlobAuditingPolicyProperties properties of an extended server blob auditing policy. +type ExtendedServerBlobAuditingPolicyProperties struct { + // PredicateExpression - Specifies condition of where clause when creating an audit. + PredicateExpression *string `json:"predicateExpression,omitempty"` + // State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled' + State BlobAuditingPolicyState `json:"state,omitempty"` + // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. + StorageEndpoint *string `json:"storageEndpoint,omitempty"` + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. + // If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + // Prerequisites for using managed identity authentication: + // 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + // For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. + RetentionDays *int32 `json:"retentionDays,omitempty"` + // AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit. + // + // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: + // + // BATCH_COMPLETED_GROUP, + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + // FAILED_DATABASE_AUTHENTICATION_GROUP. + // + // This above combination is also the set that is configured by default when enabling auditing from the Azure portal. + // + // The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + // + // APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + // BACKUP_RESTORE_GROUP + // DATABASE_LOGOUT_GROUP + // DATABASE_OBJECT_CHANGE_GROUP + // DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + // DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + // DATABASE_OPERATION_GROUP + // DATABASE_PERMISSION_CHANGE_GROUP + // DATABASE_PRINCIPAL_CHANGE_GROUP + // DATABASE_PRINCIPAL_IMPERSONATION_GROUP + // DATABASE_ROLE_MEMBER_CHANGE_GROUP + // FAILED_DATABASE_AUTHENTICATION_GROUP + // SCHEMA_OBJECT_ACCESS_GROUP + // SCHEMA_OBJECT_CHANGE_GROUP + // SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + // SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + // USER_CHANGE_PASSWORD_GROUP + // BATCH_STARTED_GROUP + // BATCH_COMPLETED_GROUP + // + // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. + // + // For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + // + // For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: + // SELECT + // UPDATE + // INSERT + // DELETE + // EXECUTE + // RECEIVE + // REFERENCES + // + // The general form for defining an action to be audited is: + // {action} ON {object} BY {principal} + // + // Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. + // + // For example: + // SELECT on dbo.myTable by public + // SELECT on DATABASE::myDatabase by public + // SELECT on SCHEMA::mySchema by public + // + // For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"` + // StorageAccountSubscriptionID - Specifies the blob storage subscription Id. + StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` + // IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key. + IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` + // IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor. + // In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. + // + // When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. + // Note that for server level audit you should use the 'master' database as {databaseName}. + // + // Diagnostic Settings URI format: + // PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + // + // For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) + // or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) + IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"` + // QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. + // The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. + QueueDelayMs *int32 `json:"queueDelayMs,omitempty"` +} + +// ExtendedSQLPoolBlobAuditingPolicy an extended Sql pool blob auditing policy. +type ExtendedSQLPoolBlobAuditingPolicy struct { + autorest.Response `json:"-"` + // ExtendedSQLPoolBlobAuditingPolicyProperties - Resource properties. + *ExtendedSQLPoolBlobAuditingPolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExtendedSQLPoolBlobAuditingPolicy. +func (espbap ExtendedSQLPoolBlobAuditingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if espbap.ExtendedSQLPoolBlobAuditingPolicyProperties != nil { + objectMap["properties"] = espbap.ExtendedSQLPoolBlobAuditingPolicyProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeSsisCatalogInfo struct. -func (irsci *IntegrationRuntimeSsisCatalogInfo) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ExtendedSQLPoolBlobAuditingPolicy struct. +func (espbap *ExtendedSQLPoolBlobAuditingPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -2235,53 +2124,41 @@ func (irsci *IntegrationRuntimeSsisCatalogInfo) UnmarshalJSON(body []byte) error } for k, v := range m { switch k { - default: + case "properties": if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) + var extendedSQLPoolBlobAuditingPolicyProperties ExtendedSQLPoolBlobAuditingPolicyProperties + err = json.Unmarshal(*v, &extendedSQLPoolBlobAuditingPolicyProperties) if err != nil { return err } - if irsci.AdditionalProperties == nil { - irsci.AdditionalProperties = make(map[string]interface{}) - } - irsci.AdditionalProperties[k] = additionalProperties + espbap.ExtendedSQLPoolBlobAuditingPolicyProperties = &extendedSQLPoolBlobAuditingPolicyProperties } - case "catalogServerEndpoint": + case "id": if v != nil { - var catalogServerEndpoint string - err = json.Unmarshal(*v, &catalogServerEndpoint) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - irsci.CatalogServerEndpoint = &catalogServerEndpoint - } - case "catalogAdminUserName": - if v != nil { - var catalogAdminUserName string - err = json.Unmarshal(*v, &catalogAdminUserName) - if err != nil { - return err - } - irsci.CatalogAdminUserName = &catalogAdminUserName + espbap.ID = &ID } - case "catalogAdminPassword": + case "name": if v != nil { - var catalogAdminPassword SecureString - err = json.Unmarshal(*v, &catalogAdminPassword) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - irsci.CatalogAdminPassword = &catalogAdminPassword + espbap.Name = &name } - case "catalogPricingTier": + case "type": if v != nil { - var catalogPricingTier IntegrationRuntimeSsisCatalogPricingTier - err = json.Unmarshal(*v, &catalogPricingTier) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - irsci.CatalogPricingTier = catalogPricingTier + espbap.Type = &typeVar } } } @@ -2289,226 +2166,291 @@ func (irsci *IntegrationRuntimeSsisCatalogInfo) UnmarshalJSON(body []byte) error return nil } -// IntegrationRuntimeSsisProperties SSIS properties for managed integration runtime. -type IntegrationRuntimeSsisProperties struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // CatalogInfo - Catalog information for managed dedicated integration runtime. - CatalogInfo *IntegrationRuntimeSsisCatalogInfo `json:"catalogInfo,omitempty"` - // LicenseType - License type for bringing your own license scenario. Possible values include: 'BasePrice', 'LicenseIncluded' - LicenseType IntegrationRuntimeLicenseType `json:"licenseType,omitempty"` - // CustomSetupScriptProperties - Custom setup script properties for a managed dedicated integration runtime. - CustomSetupScriptProperties *IntegrationRuntimeCustomSetupScriptProperties `json:"customSetupScriptProperties,omitempty"` - // DataProxyProperties - Data proxy properties for a managed dedicated integration runtime. - DataProxyProperties *IntegrationRuntimeDataProxyProperties `json:"dataProxyProperties,omitempty"` - // Edition - The edition for the SSIS Integration Runtime. Possible values include: 'Standard', 'Enterprise' - Edition IntegrationRuntimeEdition `json:"edition,omitempty"` - // ExpressCustomSetupProperties - Custom setup without script properties for a SSIS integration runtime. - ExpressCustomSetupProperties *[]BasicCustomSetupBase `json:"expressCustomSetupProperties,omitempty"` +// ExtendedSQLPoolBlobAuditingPolicyListResult a list of sql pool extended auditing settings. +type ExtendedSQLPoolBlobAuditingPolicyListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]ExtendedSQLPoolBlobAuditingPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for IntegrationRuntimeSsisProperties. -func (irsp IntegrationRuntimeSsisProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if irsp.CatalogInfo != nil { - objectMap["catalogInfo"] = irsp.CatalogInfo - } - if irsp.LicenseType != "" { - objectMap["licenseType"] = irsp.LicenseType - } - if irsp.CustomSetupScriptProperties != nil { - objectMap["customSetupScriptProperties"] = irsp.CustomSetupScriptProperties - } - if irsp.DataProxyProperties != nil { - objectMap["dataProxyProperties"] = irsp.DataProxyProperties - } - if irsp.Edition != "" { - objectMap["edition"] = irsp.Edition - } - if irsp.ExpressCustomSetupProperties != nil { - objectMap["expressCustomSetupProperties"] = irsp.ExpressCustomSetupProperties - } - for k, v := range irsp.AdditionalProperties { - objectMap[k] = v - } - return json.Marshal(objectMap) +// ExtendedSQLPoolBlobAuditingPolicyListResultIterator provides access to a complete listing of +// ExtendedSQLPoolBlobAuditingPolicy values. +type ExtendedSQLPoolBlobAuditingPolicyListResultIterator struct { + i int + page ExtendedSQLPoolBlobAuditingPolicyListResultPage } -// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeSsisProperties struct. -func (irsp *IntegrationRuntimeSsisProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// 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 *ExtendedSQLPoolBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedSQLPoolBlobAuditingPolicyListResultIterator.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 } - for k, v := range m { - switch k { - default: - if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) - if err != nil { - return err - } - if irsp.AdditionalProperties == nil { - irsp.AdditionalProperties = make(map[string]interface{}) - } - irsp.AdditionalProperties[k] = additionalProperties - } - case "catalogInfo": - if v != nil { - var catalogInfo IntegrationRuntimeSsisCatalogInfo - err = json.Unmarshal(*v, &catalogInfo) - if err != nil { - return err - } - irsp.CatalogInfo = &catalogInfo - } - case "licenseType": - if v != nil { - var licenseType IntegrationRuntimeLicenseType - err = json.Unmarshal(*v, &licenseType) - if err != nil { - return err - } - irsp.LicenseType = licenseType - } - case "customSetupScriptProperties": - if v != nil { - var customSetupScriptProperties IntegrationRuntimeCustomSetupScriptProperties - err = json.Unmarshal(*v, &customSetupScriptProperties) - if err != nil { - return err - } - irsp.CustomSetupScriptProperties = &customSetupScriptProperties - } - case "dataProxyProperties": - if v != nil { - var dataProxyProperties IntegrationRuntimeDataProxyProperties - err = json.Unmarshal(*v, &dataProxyProperties) - if err != nil { - return err - } - irsp.DataProxyProperties = &dataProxyProperties - } - case "edition": - if v != nil { - var edition IntegrationRuntimeEdition - err = json.Unmarshal(*v, &edition) - if err != nil { - return err - } - irsp.Edition = edition - } - case "expressCustomSetupProperties": - if v != nil { - expressCustomSetupProperties, err := unmarshalBasicCustomSetupBaseArray(*v) - if err != nil { - return err - } - irsp.ExpressCustomSetupProperties = &expressCustomSetupProperties - } - } - } - + iter.i = 0 return nil } -// BasicIntegrationRuntimeStatus integration runtime status. -type BasicIntegrationRuntimeStatus interface { - AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) - AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) - AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) +// 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 *ExtendedSQLPoolBlobAuditingPolicyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// IntegrationRuntimeStatus integration runtime status. -type IntegrationRuntimeStatus struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // DataFactoryName - READ-ONLY; The workspace name which the integration runtime belong to. - DataFactoryName *string `json:"dataFactoryName,omitempty"` - // State - READ-ONLY; The state of integration runtime. Possible values include: 'Initial', 'Stopped', 'Started', 'Starting', 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline', 'AccessDenied' - State IntegrationRuntimeState `json:"state,omitempty"` - // Type - Possible values include: 'TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus', 'TypeBasicIntegrationRuntimeStatusTypeManaged', 'TypeBasicIntegrationRuntimeStatusTypeSelfHosted' - Type TypeBasicIntegrationRuntimeStatus `json:"type,omitempty"` +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExtendedSQLPoolBlobAuditingPolicyListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -func unmarshalBasicIntegrationRuntimeStatus(body []byte) (BasicIntegrationRuntimeStatus, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } +// Response returns the raw server response from the last page request. +func (iter ExtendedSQLPoolBlobAuditingPolicyListResultIterator) Response() ExtendedSQLPoolBlobAuditingPolicyListResult { + return iter.page.Response() +} - switch m["type"] { - case string(TypeBasicIntegrationRuntimeStatusTypeManaged): - var mirs ManagedIntegrationRuntimeStatus - err := json.Unmarshal(body, &mirs) - return mirs, err - case string(TypeBasicIntegrationRuntimeStatusTypeSelfHosted): - var shirs SelfHostedIntegrationRuntimeStatus - err := json.Unmarshal(body, &shirs) - return shirs, err - default: - var irs IntegrationRuntimeStatus - err := json.Unmarshal(body, &irs) - return irs, err +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ExtendedSQLPoolBlobAuditingPolicyListResultIterator) Value() ExtendedSQLPoolBlobAuditingPolicy { + if !iter.page.NotDone() { + return ExtendedSQLPoolBlobAuditingPolicy{} } + return iter.page.Values()[iter.i] } -func unmarshalBasicIntegrationRuntimeStatusArray(body []byte) ([]BasicIntegrationRuntimeStatus, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - irsArray := make([]BasicIntegrationRuntimeStatus, len(rawMessages)) - for index, rawMessage := range rawMessages { - irs, err := unmarshalBasicIntegrationRuntimeStatus(*rawMessage) - if err != nil { - return nil, err - } - irsArray[index] = irs - } - return irsArray, nil +// Creates a new instance of the ExtendedSQLPoolBlobAuditingPolicyListResultIterator type. +func NewExtendedSQLPoolBlobAuditingPolicyListResultIterator(page ExtendedSQLPoolBlobAuditingPolicyListResultPage) ExtendedSQLPoolBlobAuditingPolicyListResultIterator { + return ExtendedSQLPoolBlobAuditingPolicyListResultIterator{page: page} } -// MarshalJSON is the custom marshaler for IntegrationRuntimeStatus. -func (irs IntegrationRuntimeStatus) MarshalJSON() ([]byte, error) { - irs.Type = TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus - objectMap := make(map[string]interface{}) - if irs.Type != "" { - objectMap["type"] = irs.Type - } - for k, v := range irs.AdditionalProperties { - objectMap[k] = v - } - return json.Marshal(objectMap) +// IsEmpty returns true if the ListResult contains no values. +func (espbaplr ExtendedSQLPoolBlobAuditingPolicyListResult) IsEmpty() bool { + return espbaplr.Value == nil || len(*espbaplr.Value) == 0 } -// AsManagedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus. -func (irs IntegrationRuntimeStatus) AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) { - return nil, false +// hasNextLink returns true if the NextLink is not empty. +func (espbaplr ExtendedSQLPoolBlobAuditingPolicyListResult) hasNextLink() bool { + return espbaplr.NextLink != nil && len(*espbaplr.NextLink) != 0 } -// AsSelfHostedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus. -func (irs IntegrationRuntimeStatus) AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) { - return nil, false +// extendedSQLPoolBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (espbaplr ExtendedSQLPoolBlobAuditingPolicyListResult) extendedSQLPoolBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if !espbaplr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(espbaplr.NextLink))) } -// AsIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus. -func (irs IntegrationRuntimeStatus) AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) { - return &irs, true +// ExtendedSQLPoolBlobAuditingPolicyListResultPage contains a page of ExtendedSQLPoolBlobAuditingPolicy +// values. +type ExtendedSQLPoolBlobAuditingPolicyListResultPage struct { + fn func(context.Context, ExtendedSQLPoolBlobAuditingPolicyListResult) (ExtendedSQLPoolBlobAuditingPolicyListResult, error) + espbaplr ExtendedSQLPoolBlobAuditingPolicyListResult } -// AsBasicIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus. -func (irs IntegrationRuntimeStatus) AsBasicIntegrationRuntimeStatus() (BasicIntegrationRuntimeStatus, bool) { - return &irs, true +// 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 *ExtendedSQLPoolBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedSQLPoolBlobAuditingPolicyListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.espbaplr) + if err != nil { + return err + } + page.espbaplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil } -// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeStatus struct. -func (irs *IntegrationRuntimeStatus) UnmarshalJSON(body []byte) error { +// 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 *ExtendedSQLPoolBlobAuditingPolicyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExtendedSQLPoolBlobAuditingPolicyListResultPage) NotDone() bool { + return !page.espbaplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExtendedSQLPoolBlobAuditingPolicyListResultPage) Response() ExtendedSQLPoolBlobAuditingPolicyListResult { + return page.espbaplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExtendedSQLPoolBlobAuditingPolicyListResultPage) Values() []ExtendedSQLPoolBlobAuditingPolicy { + if page.espbaplr.IsEmpty() { + return nil + } + return *page.espbaplr.Value +} + +// Creates a new instance of the ExtendedSQLPoolBlobAuditingPolicyListResultPage type. +func NewExtendedSQLPoolBlobAuditingPolicyListResultPage(cur ExtendedSQLPoolBlobAuditingPolicyListResult, getNextPage func(context.Context, ExtendedSQLPoolBlobAuditingPolicyListResult) (ExtendedSQLPoolBlobAuditingPolicyListResult, error)) ExtendedSQLPoolBlobAuditingPolicyListResultPage { + return ExtendedSQLPoolBlobAuditingPolicyListResultPage{ + fn: getNextPage, + espbaplr: cur, + } +} + +// ExtendedSQLPoolBlobAuditingPolicyProperties properties of an extended Sql pool blob auditing policy. +type ExtendedSQLPoolBlobAuditingPolicyProperties struct { + // PredicateExpression - Specifies condition of where clause when creating an audit. + PredicateExpression *string `json:"predicateExpression,omitempty"` + // State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled' + State BlobAuditingPolicyState `json:"state,omitempty"` + // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. + StorageEndpoint *string `json:"storageEndpoint,omitempty"` + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. + // If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + // Prerequisites for using managed identity authentication: + // 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + // For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. + RetentionDays *int32 `json:"retentionDays,omitempty"` + // AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit. + // + // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: + // + // BATCH_COMPLETED_GROUP, + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + // FAILED_DATABASE_AUTHENTICATION_GROUP. + // + // This above combination is also the set that is configured by default when enabling auditing from the Azure portal. + // + // The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + // + // APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + // BACKUP_RESTORE_GROUP + // DATABASE_LOGOUT_GROUP + // DATABASE_OBJECT_CHANGE_GROUP + // DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + // DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + // DATABASE_OPERATION_GROUP + // DATABASE_PERMISSION_CHANGE_GROUP + // DATABASE_PRINCIPAL_CHANGE_GROUP + // DATABASE_PRINCIPAL_IMPERSONATION_GROUP + // DATABASE_ROLE_MEMBER_CHANGE_GROUP + // FAILED_DATABASE_AUTHENTICATION_GROUP + // SCHEMA_OBJECT_ACCESS_GROUP + // SCHEMA_OBJECT_CHANGE_GROUP + // SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + // SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + // USER_CHANGE_PASSWORD_GROUP + // BATCH_STARTED_GROUP + // BATCH_COMPLETED_GROUP + // + // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. + // + // For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + // + // For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: + // SELECT + // UPDATE + // INSERT + // DELETE + // EXECUTE + // RECEIVE + // REFERENCES + // + // The general form for defining an action to be audited is: + // {action} ON {object} BY {principal} + // + // Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. + // + // For example: + // SELECT on dbo.myTable by public + // SELECT on DATABASE::myDatabase by public + // SELECT on SCHEMA::mySchema by public + // + // For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"` + // StorageAccountSubscriptionID - Specifies the blob storage subscription Id. + StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` + // IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key. + IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` + // IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor. + // In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. + // + // When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. + // Note that for server level audit you should use the 'master' database as {databaseName}. + // + // Diagnostic Settings URI format: + // PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + // + // For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) + // or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) + IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"` + // QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. + // The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. + QueueDelayMs *int32 `json:"queueDelayMs,omitempty"` +} + +// GeoBackupPolicy a database geo backup policy. +type GeoBackupPolicy struct { + autorest.Response `json:"-"` + // GeoBackupPolicyProperties - The properties of the geo backup policy. + *GeoBackupPolicyProperties `json:"properties,omitempty"` + // Kind - READ-ONLY; Kind of geo backup policy. This is metadata used for the Azure portal experience. + Kind *string `json:"kind,omitempty"` + // Location - READ-ONLY; Backup policy location. + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for GeoBackupPolicy. +func (gbp GeoBackupPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gbp.GeoBackupPolicyProperties != nil { + objectMap["properties"] = gbp.GeoBackupPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GeoBackupPolicy struct. +func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -2516,76 +2458,42 @@ func (irs *IntegrationRuntimeStatus) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - default: + case "properties": if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) + var geoBackupPolicyProperties GeoBackupPolicyProperties + err = json.Unmarshal(*v, &geoBackupPolicyProperties) if err != nil { return err } - if irs.AdditionalProperties == nil { - irs.AdditionalProperties = make(map[string]interface{}) - } - irs.AdditionalProperties[k] = additionalProperties + gbp.GeoBackupPolicyProperties = &geoBackupPolicyProperties } - case "dataFactoryName": + case "kind": if v != nil { - var dataFactoryName string - err = json.Unmarshal(*v, &dataFactoryName) + var kind string + err = json.Unmarshal(*v, &kind) if err != nil { return err } - irs.DataFactoryName = &dataFactoryName + gbp.Kind = &kind } - case "state": + case "location": if v != nil { - var state IntegrationRuntimeState - err = json.Unmarshal(*v, &state) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - irs.State = state + gbp.Location = &location } - case "type": + case "id": if v != nil { - var typeVar TypeBasicIntegrationRuntimeStatus - err = json.Unmarshal(*v, &typeVar) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - irs.Type = typeVar + gbp.ID = &ID } - } - } - - return nil -} - -// IntegrationRuntimeStatusResponse integration runtime status response. -type IntegrationRuntimeStatusResponse struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; The integration runtime name. - Name *string `json:"name,omitempty"` - // Properties - Integration runtime properties. - Properties BasicIntegrationRuntimeStatus `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for IntegrationRuntimeStatusResponse. -func (irsr IntegrationRuntimeStatusResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = irsr.Properties - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeStatusResponse struct. -func (irsr *IntegrationRuntimeStatusResponse) 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 "name": if v != nil { var name string @@ -2593,15 +2501,16 @@ func (irsr *IntegrationRuntimeStatusResponse) UnmarshalJSON(body []byte) error { if err != nil { return err } - irsr.Name = &name + gbp.Name = &name } - case "properties": + case "type": if v != nil { - properties, err := unmarshalBasicIntegrationRuntimeStatus(*v) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - irsr.Properties = properties + gbp.Type = &typeVar } } } @@ -2609,38 +2518,132 @@ func (irsr *IntegrationRuntimeStatusResponse) UnmarshalJSON(body []byte) error { return nil } -// IntegrationRuntimeVNetProperties vNet properties for managed integration runtime. -type IntegrationRuntimeVNetProperties struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // VNetID - The ID of the VNet that this integration runtime will join. - VNetID *string `json:"vNetId,omitempty"` - // Subnet - The name of the subnet this integration runtime will join. - Subnet *string `json:"subnet,omitempty"` - // PublicIPs - Resource IDs of the public IP addresses that this integration runtime will use. - PublicIPs *[]string `json:"publicIPs,omitempty"` +// GeoBackupPolicyListResult the response to a list geo backup policies request. +type GeoBackupPolicyListResult struct { + autorest.Response `json:"-"` + // Value - The list of geo backup policies. + Value *[]GeoBackupPolicy `json:"value,omitempty"` } -// MarshalJSON is the custom marshaler for IntegrationRuntimeVNetProperties. -func (irvnp IntegrationRuntimeVNetProperties) MarshalJSON() ([]byte, error) { +// GeoBackupPolicyProperties the properties of the geo backup policy. +type GeoBackupPolicyProperties struct { + // State - The state of the geo backup policy. Possible values include: 'GeoBackupPolicyStateDisabled', 'GeoBackupPolicyStateEnabled' + State GeoBackupPolicyState `json:"state,omitempty"` + // StorageType - READ-ONLY; The storage type of the geo backup policy. + StorageType *string `json:"storageType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GeoBackupPolicyProperties. +func (gbpp GeoBackupPolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if irvnp.VNetID != nil { - objectMap["vNetId"] = irvnp.VNetID - } - if irvnp.Subnet != nil { - objectMap["subnet"] = irvnp.Subnet + if gbpp.State != "" { + objectMap["state"] = gbpp.State } - if irvnp.PublicIPs != nil { - objectMap["publicIPs"] = irvnp.PublicIPs + return json.Marshal(objectMap) +} + +// GetSsisObjectMetadataRequest the request payload of get SSIS object metadata. +type GetSsisObjectMetadataRequest struct { + // MetadataPath - Metadata path. + MetadataPath *string `json:"metadataPath,omitempty"` +} + +// BasicIntegrationRuntime azure Synapse nested object which serves as a compute resource for activities. +type BasicIntegrationRuntime interface { + AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) + AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) + AsIntegrationRuntime() (*IntegrationRuntime, bool) +} + +// IntegrationRuntime azure Synapse nested object which serves as a compute resource for activities. +type IntegrationRuntime struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Integration runtime description. + Description *string `json:"description,omitempty"` + // Type - Possible values include: 'TypeIntegrationRuntime', 'TypeManaged', 'TypeSelfHosted' + Type Type `json:"type,omitempty"` +} + +func unmarshalBasicIntegrationRuntime(body []byte) (BasicIntegrationRuntime, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err } - for k, v := range irvnp.AdditionalProperties { + + switch m["type"] { + case string(TypeManaged): + var mir ManagedIntegrationRuntime + err := json.Unmarshal(body, &mir) + return mir, err + case string(TypeSelfHosted): + var shir SelfHostedIntegrationRuntime + err := json.Unmarshal(body, &shir) + return shir, err + default: + var ir IntegrationRuntime + err := json.Unmarshal(body, &ir) + return ir, err + } +} +func unmarshalBasicIntegrationRuntimeArray(body []byte) ([]BasicIntegrationRuntime, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + irArray := make([]BasicIntegrationRuntime, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ir, err := unmarshalBasicIntegrationRuntime(*rawMessage) + if err != nil { + return nil, err + } + irArray[index] = ir + } + return irArray, nil +} + +// MarshalJSON is the custom marshaler for IntegrationRuntime. +func (ir IntegrationRuntime) MarshalJSON() ([]byte, error) { + ir.Type = TypeIntegrationRuntime + objectMap := make(map[string]interface{}) + if ir.Description != nil { + objectMap["description"] = ir.Description + } + if ir.Type != "" { + objectMap["type"] = ir.Type + } + for k, v := range ir.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeVNetProperties struct. -func (irvnp *IntegrationRuntimeVNetProperties) UnmarshalJSON(body []byte) error { +// AsManagedIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime. +func (ir IntegrationRuntime) AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) { + return nil, false +} + +// AsSelfHostedIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime. +func (ir IntegrationRuntime) AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) { + return nil, false +} + +// AsIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime. +func (ir IntegrationRuntime) AsIntegrationRuntime() (*IntegrationRuntime, bool) { + return &ir, true +} + +// AsBasicIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime. +func (ir IntegrationRuntime) AsBasicIntegrationRuntime() (BasicIntegrationRuntime, bool) { + return &ir, true +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntime struct. +func (ir *IntegrationRuntime) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -2655,37 +2658,28 @@ func (irvnp *IntegrationRuntimeVNetProperties) UnmarshalJSON(body []byte) error if err != nil { return err } - if irvnp.AdditionalProperties == nil { - irvnp.AdditionalProperties = make(map[string]interface{}) - } - irvnp.AdditionalProperties[k] = additionalProperties - } - case "vNetId": - if v != nil { - var vNetID string - err = json.Unmarshal(*v, &vNetID) - if err != nil { - return err + if ir.AdditionalProperties == nil { + ir.AdditionalProperties = make(map[string]interface{}) } - irvnp.VNetID = &vNetID + ir.AdditionalProperties[k] = additionalProperties } - case "subnet": + case "description": if v != nil { - var subnet string - err = json.Unmarshal(*v, &subnet) + var description string + err = json.Unmarshal(*v, &description) if err != nil { return err } - irvnp.Subnet = &subnet + ir.Description = &description } - case "publicIPs": + case "type": if v != nil { - var publicIPs []string - err = json.Unmarshal(*v, &publicIPs) + var typeVar Type + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - irvnp.PublicIPs = &publicIPs + ir.Type = typeVar } } } @@ -2693,30 +2687,62 @@ func (irvnp *IntegrationRuntimeVNetProperties) UnmarshalJSON(body []byte) error return nil } -// IPFirewallRuleInfo IP firewall rule -type IPFirewallRuleInfo struct { +// IntegrationRuntimeAuthKeys the integration runtime authentication keys. +type IntegrationRuntimeAuthKeys struct { autorest.Response `json:"-"` - // IPFirewallRuleProperties - IP firewall rule properties - *IPFirewallRuleProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` + // AuthKey1 - The primary integration runtime authentication key. + AuthKey1 *string `json:"authKey1,omitempty"` + // AuthKey2 - The secondary integration runtime authentication key. + AuthKey2 *string `json:"authKey2,omitempty"` } -// MarshalJSON is the custom marshaler for IPFirewallRuleInfo. -func (ifri IPFirewallRuleInfo) MarshalJSON() ([]byte, error) { +// IntegrationRuntimeComputeProperties the compute resource properties for managed integration runtime. +type IntegrationRuntimeComputeProperties struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Location - The location for managed integration runtime. The supported regions could be found on https://docs.microsoft.com/en-us/azure/data-factory/data-factory-data-movement-activities + Location *string `json:"location,omitempty"` + // NodeSize - The node size requirement to managed integration runtime. + NodeSize *string `json:"nodeSize,omitempty"` + // NumberOfNodes - The required number of nodes for managed integration runtime. + NumberOfNodes *int32 `json:"numberOfNodes,omitempty"` + // MaxParallelExecutionsPerNode - Maximum parallel executions count per node for managed integration runtime. + MaxParallelExecutionsPerNode *int32 `json:"maxParallelExecutionsPerNode,omitempty"` + // DataFlowProperties - Data flow properties for managed integration runtime. + DataFlowProperties *IntegrationRuntimeDataFlowProperties `json:"dataFlowProperties,omitempty"` + // VNetProperties - VNet properties for managed integration runtime. + VNetProperties *IntegrationRuntimeVNetProperties `json:"vNetProperties,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeComputeProperties. +func (ircp IntegrationRuntimeComputeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ifri.IPFirewallRuleProperties != nil { - objectMap["properties"] = ifri.IPFirewallRuleProperties + if ircp.Location != nil { + objectMap["location"] = ircp.Location + } + if ircp.NodeSize != nil { + objectMap["nodeSize"] = ircp.NodeSize + } + if ircp.NumberOfNodes != nil { + objectMap["numberOfNodes"] = ircp.NumberOfNodes + } + if ircp.MaxParallelExecutionsPerNode != nil { + objectMap["maxParallelExecutionsPerNode"] = ircp.MaxParallelExecutionsPerNode + } + if ircp.DataFlowProperties != nil { + objectMap["dataFlowProperties"] = ircp.DataFlowProperties + } + if ircp.VNetProperties != nil { + objectMap["vNetProperties"] = ircp.VNetProperties + } + for k, v := range ircp.AdditionalProperties { + objectMap[k] = v } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IPFirewallRuleInfo struct. -func (ifri *IPFirewallRuleInfo) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeComputeProperties struct. +func (ircp *IntegrationRuntimeComputeProperties) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -2724,68 +2750,3630 @@ func (ifri *IPFirewallRuleInfo) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": + default: if v != nil { - var IPFirewallRuleProperties IPFirewallRuleProperties - err = json.Unmarshal(*v, &IPFirewallRuleProperties) + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) if err != nil { return err } - ifri.IPFirewallRuleProperties = &IPFirewallRuleProperties + if ircp.AdditionalProperties == nil { + ircp.AdditionalProperties = make(map[string]interface{}) + } + ircp.AdditionalProperties[k] = additionalProperties } - case "id": + case "location": if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - ifri.ID = &ID + ircp.Location = &location } - case "name": + case "nodeSize": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var nodeSize string + err = json.Unmarshal(*v, &nodeSize) if err != nil { return err } - ifri.Name = &name + ircp.NodeSize = &nodeSize } - case "type": + case "numberOfNodes": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var numberOfNodes int32 + err = json.Unmarshal(*v, &numberOfNodes) if err != nil { return err } - ifri.Type = &typeVar + ircp.NumberOfNodes = &numberOfNodes } - } - } - - return nil -} - -// IPFirewallRuleInfoListResult list of IP firewall rules -type IPFirewallRuleInfoListResult struct { - autorest.Response `json:"-"` - // NextLink - Link to next page of results - NextLink *string `json:"nextLink,omitempty"` - // Value - List of IP firewall rules - Value *[]IPFirewallRuleInfo `json:"value,omitempty"` -} - -// IPFirewallRuleInfoListResultIterator provides access to a complete listing of IPFirewallRuleInfo values. -type IPFirewallRuleInfoListResultIterator struct { - i int - page IPFirewallRuleInfoListResultPage -} - -// 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 *IPFirewallRuleInfoListResultIterator) NextWithContext(ctx context.Context) (err error) { + case "maxParallelExecutionsPerNode": + if v != nil { + var maxParallelExecutionsPerNode int32 + err = json.Unmarshal(*v, &maxParallelExecutionsPerNode) + if err != nil { + return err + } + ircp.MaxParallelExecutionsPerNode = &maxParallelExecutionsPerNode + } + case "dataFlowProperties": + if v != nil { + var dataFlowProperties IntegrationRuntimeDataFlowProperties + err = json.Unmarshal(*v, &dataFlowProperties) + if err != nil { + return err + } + ircp.DataFlowProperties = &dataFlowProperties + } + case "vNetProperties": + if v != nil { + var vNetProperties IntegrationRuntimeVNetProperties + err = json.Unmarshal(*v, &vNetProperties) + if err != nil { + return err + } + ircp.VNetProperties = &vNetProperties + } + } + } + + return nil +} + +// IntegrationRuntimeConnectionInfo connection information for encrypting the on-premises data source +// credentials. +type IntegrationRuntimeConnectionInfo struct { + autorest.Response `json:"-"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ServiceToken - READ-ONLY; The token generated in service. Callers use this token to authenticate to integration runtime. + ServiceToken *string `json:"serviceToken,omitempty"` + // IdentityCertThumbprint - READ-ONLY; The integration runtime SSL certificate thumbprint. Click-Once application uses it to do server validation. + IdentityCertThumbprint *string `json:"identityCertThumbprint,omitempty"` + // HostServiceURI - READ-ONLY; The on-premises integration runtime host URL. + HostServiceURI *string `json:"hostServiceUri,omitempty"` + // Version - READ-ONLY; The integration runtime version. + Version *string `json:"version,omitempty"` + // PublicKey - READ-ONLY; The public key for encrypting a credential when transferring the credential to the integration runtime. + PublicKey *string `json:"publicKey,omitempty"` + // IsIdentityCertExprired - READ-ONLY; Whether the identity certificate is expired. + IsIdentityCertExprired *bool `json:"isIdentityCertExprired,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeConnectionInfo. +func (irci IntegrationRuntimeConnectionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + for k, v := range irci.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeConnectionInfo struct. +func (irci *IntegrationRuntimeConnectionInfo) 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 { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if irci.AdditionalProperties == nil { + irci.AdditionalProperties = make(map[string]interface{}) + } + irci.AdditionalProperties[k] = additionalProperties + } + case "serviceToken": + if v != nil { + var serviceToken string + err = json.Unmarshal(*v, &serviceToken) + if err != nil { + return err + } + irci.ServiceToken = &serviceToken + } + case "identityCertThumbprint": + if v != nil { + var identityCertThumbprint string + err = json.Unmarshal(*v, &identityCertThumbprint) + if err != nil { + return err + } + irci.IdentityCertThumbprint = &identityCertThumbprint + } + case "hostServiceUri": + if v != nil { + var hostServiceURI string + err = json.Unmarshal(*v, &hostServiceURI) + if err != nil { + return err + } + irci.HostServiceURI = &hostServiceURI + } + case "version": + if v != nil { + var version string + err = json.Unmarshal(*v, &version) + if err != nil { + return err + } + irci.Version = &version + } + case "publicKey": + if v != nil { + var publicKey string + err = json.Unmarshal(*v, &publicKey) + if err != nil { + return err + } + irci.PublicKey = &publicKey + } + case "isIdentityCertExprired": + if v != nil { + var isIdentityCertExprired bool + err = json.Unmarshal(*v, &isIdentityCertExprired) + if err != nil { + return err + } + irci.IsIdentityCertExprired = &isIdentityCertExprired + } + } + } + + return nil +} + +// IntegrationRuntimeCustomSetupScriptProperties custom setup script properties for a managed dedicated +// integration runtime. +type IntegrationRuntimeCustomSetupScriptProperties struct { + // BlobContainerURI - The URI of the Azure blob container that contains the custom setup script. + BlobContainerURI *string `json:"blobContainerUri,omitempty"` + // SasToken - The SAS token of the Azure blob container. + SasToken *SecureString `json:"sasToken,omitempty"` +} + +// IntegrationRuntimeDataFlowProperties data flow properties for managed integration runtime. +type IntegrationRuntimeDataFlowProperties struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ComputeType - Compute type of the cluster which will execute data flow job. Possible values include: 'General', 'MemoryOptimized', 'ComputeOptimized' + ComputeType DataFlowComputeType `json:"computeType,omitempty"` + // CoreCount - Core count of the cluster which will execute data flow job. Supported values are: 8, 16, 32, 48, 80, 144 and 272. + CoreCount *int32 `json:"coreCount,omitempty"` + // TimeToLive - Time to live (in minutes) setting of the cluster which will execute data flow job. + TimeToLive *int32 `json:"timeToLive,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeDataFlowProperties. +func (irdfp IntegrationRuntimeDataFlowProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if irdfp.ComputeType != "" { + objectMap["computeType"] = irdfp.ComputeType + } + if irdfp.CoreCount != nil { + objectMap["coreCount"] = irdfp.CoreCount + } + if irdfp.TimeToLive != nil { + objectMap["timeToLive"] = irdfp.TimeToLive + } + for k, v := range irdfp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeDataFlowProperties struct. +func (irdfp *IntegrationRuntimeDataFlowProperties) 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 { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if irdfp.AdditionalProperties == nil { + irdfp.AdditionalProperties = make(map[string]interface{}) + } + irdfp.AdditionalProperties[k] = additionalProperties + } + case "computeType": + if v != nil { + var computeType DataFlowComputeType + err = json.Unmarshal(*v, &computeType) + if err != nil { + return err + } + irdfp.ComputeType = computeType + } + case "coreCount": + if v != nil { + var coreCount int32 + err = json.Unmarshal(*v, &coreCount) + if err != nil { + return err + } + irdfp.CoreCount = &coreCount + } + case "timeToLive": + if v != nil { + var timeToLive int32 + err = json.Unmarshal(*v, &timeToLive) + if err != nil { + return err + } + irdfp.TimeToLive = &timeToLive + } + } + } + + return nil +} + +// IntegrationRuntimeDataProxyProperties data proxy properties for a managed dedicated integration runtime. +type IntegrationRuntimeDataProxyProperties struct { + // ConnectVia - The self-hosted integration runtime reference. + ConnectVia *EntityReference `json:"connectVia,omitempty"` + // StagingLinkedService - The staging linked service reference. + StagingLinkedService *EntityReference `json:"stagingLinkedService,omitempty"` + // Path - The path to contain the staged data in the Blob storage. + Path *string `json:"path,omitempty"` +} + +// IntegrationRuntimeListResponse a list of integration runtime resources. +type IntegrationRuntimeListResponse struct { + autorest.Response `json:"-"` + // Value - List of integration runtimes. + Value *[]IntegrationRuntimeResource `json:"value,omitempty"` + // NextLink - The link to the next page of results, if any remaining results exist. + NextLink *string `json:"nextLink,omitempty"` +} + +// IntegrationRuntimeListResponseIterator provides access to a complete listing of +// IntegrationRuntimeResource values. +type IntegrationRuntimeListResponseIterator struct { + i int + page IntegrationRuntimeListResponsePage +} + +// 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 *IntegrationRuntimeListResponseIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeListResponseIterator.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 *IntegrationRuntimeListResponseIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IntegrationRuntimeListResponseIterator) 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 IntegrationRuntimeListResponseIterator) Response() IntegrationRuntimeListResponse { + 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 IntegrationRuntimeListResponseIterator) Value() IntegrationRuntimeResource { + if !iter.page.NotDone() { + return IntegrationRuntimeResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IntegrationRuntimeListResponseIterator type. +func NewIntegrationRuntimeListResponseIterator(page IntegrationRuntimeListResponsePage) IntegrationRuntimeListResponseIterator { + return IntegrationRuntimeListResponseIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (irlr IntegrationRuntimeListResponse) IsEmpty() bool { + return irlr.Value == nil || len(*irlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (irlr IntegrationRuntimeListResponse) hasNextLink() bool { + return irlr.NextLink != nil && len(*irlr.NextLink) != 0 +} + +// integrationRuntimeListResponsePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (irlr IntegrationRuntimeListResponse) integrationRuntimeListResponsePreparer(ctx context.Context) (*http.Request, error) { + if !irlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(irlr.NextLink))) +} + +// IntegrationRuntimeListResponsePage contains a page of IntegrationRuntimeResource values. +type IntegrationRuntimeListResponsePage struct { + fn func(context.Context, IntegrationRuntimeListResponse) (IntegrationRuntimeListResponse, error) + irlr IntegrationRuntimeListResponse +} + +// 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 *IntegrationRuntimeListResponsePage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeListResponsePage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.irlr) + if err != nil { + return err + } + page.irlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IntegrationRuntimeListResponsePage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IntegrationRuntimeListResponsePage) NotDone() bool { + return !page.irlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IntegrationRuntimeListResponsePage) Response() IntegrationRuntimeListResponse { + return page.irlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IntegrationRuntimeListResponsePage) Values() []IntegrationRuntimeResource { + if page.irlr.IsEmpty() { + return nil + } + return *page.irlr.Value +} + +// Creates a new instance of the IntegrationRuntimeListResponsePage type. +func NewIntegrationRuntimeListResponsePage(cur IntegrationRuntimeListResponse, getNextPage func(context.Context, IntegrationRuntimeListResponse) (IntegrationRuntimeListResponse, error)) IntegrationRuntimeListResponsePage { + return IntegrationRuntimeListResponsePage{ + fn: getNextPage, + irlr: cur, + } +} + +// IntegrationRuntimeMonitoringData get monitoring data response. +type IntegrationRuntimeMonitoringData struct { + autorest.Response `json:"-"` + // Name - Integration runtime name. + Name *string `json:"name,omitempty"` + // Nodes - Integration runtime node monitoring data. + Nodes *[]IntegrationRuntimeNodeMonitoringData `json:"nodes,omitempty"` +} + +// IntegrationRuntimeNodeIPAddress the IP address of self-hosted integration runtime node. +type IntegrationRuntimeNodeIPAddress struct { + autorest.Response `json:"-"` + // IPAddress - READ-ONLY; The IP address of self-hosted integration runtime node. + IPAddress *string `json:"ipAddress,omitempty"` +} + +// IntegrationRuntimeNodeMonitoringData monitoring data for integration runtime node. +type IntegrationRuntimeNodeMonitoringData struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // NodeName - READ-ONLY; Name of the integration runtime node. + NodeName *string `json:"nodeName,omitempty"` + // AvailableMemoryInMB - READ-ONLY; Available memory (MB) on the integration runtime node. + AvailableMemoryInMB *int32 `json:"availableMemoryInMB,omitempty"` + // CPUUtilization - READ-ONLY; CPU percentage on the integration runtime node. + CPUUtilization *int32 `json:"cpuUtilization,omitempty"` + // ConcurrentJobsLimit - READ-ONLY; Maximum concurrent jobs on the integration runtime node. + ConcurrentJobsLimit *int32 `json:"concurrentJobsLimit,omitempty"` + // ConcurrentJobsRunning - READ-ONLY; The number of jobs currently running on the integration runtime node. + ConcurrentJobsRunning *int32 `json:"concurrentJobsRunning,omitempty"` + // MaxConcurrentJobs - READ-ONLY; The maximum concurrent jobs in this integration runtime. + MaxConcurrentJobs *int32 `json:"maxConcurrentJobs,omitempty"` + // SentBytes - READ-ONLY; Sent bytes on the integration runtime node. + SentBytes *float64 `json:"sentBytes,omitempty"` + // ReceivedBytes - READ-ONLY; Received bytes on the integration runtime node. + ReceivedBytes *float64 `json:"receivedBytes,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeNodeMonitoringData. +func (irnmd IntegrationRuntimeNodeMonitoringData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + for k, v := range irnmd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeNodeMonitoringData struct. +func (irnmd *IntegrationRuntimeNodeMonitoringData) 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 { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if irnmd.AdditionalProperties == nil { + irnmd.AdditionalProperties = make(map[string]interface{}) + } + irnmd.AdditionalProperties[k] = additionalProperties + } + case "nodeName": + if v != nil { + var nodeName string + err = json.Unmarshal(*v, &nodeName) + if err != nil { + return err + } + irnmd.NodeName = &nodeName + } + case "availableMemoryInMB": + if v != nil { + var availableMemoryInMB int32 + err = json.Unmarshal(*v, &availableMemoryInMB) + if err != nil { + return err + } + irnmd.AvailableMemoryInMB = &availableMemoryInMB + } + case "cpuUtilization": + if v != nil { + var CPUUtilization int32 + err = json.Unmarshal(*v, &CPUUtilization) + if err != nil { + return err + } + irnmd.CPUUtilization = &CPUUtilization + } + case "concurrentJobsLimit": + if v != nil { + var concurrentJobsLimit int32 + err = json.Unmarshal(*v, &concurrentJobsLimit) + if err != nil { + return err + } + irnmd.ConcurrentJobsLimit = &concurrentJobsLimit + } + case "concurrentJobsRunning": + if v != nil { + var concurrentJobsRunning int32 + err = json.Unmarshal(*v, &concurrentJobsRunning) + if err != nil { + return err + } + irnmd.ConcurrentJobsRunning = &concurrentJobsRunning + } + case "maxConcurrentJobs": + if v != nil { + var maxConcurrentJobs int32 + err = json.Unmarshal(*v, &maxConcurrentJobs) + if err != nil { + return err + } + irnmd.MaxConcurrentJobs = &maxConcurrentJobs + } + case "sentBytes": + if v != nil { + var sentBytes float64 + err = json.Unmarshal(*v, &sentBytes) + if err != nil { + return err + } + irnmd.SentBytes = &sentBytes + } + case "receivedBytes": + if v != nil { + var receivedBytes float64 + err = json.Unmarshal(*v, &receivedBytes) + if err != nil { + return err + } + irnmd.ReceivedBytes = &receivedBytes + } + } + } + + return nil +} + +// IntegrationRuntimeObjectMetadataRefreshFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type IntegrationRuntimeObjectMetadataRefreshFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IntegrationRuntimeObjectMetadataRefreshFuture) Result(client IntegrationRuntimeObjectMetadataClient) (somsr SsisObjectMetadataStatusResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataRefreshFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimeObjectMetadataRefreshFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if somsr.Response.Response, err = future.GetResult(sender); err == nil && somsr.Response.Response.StatusCode != http.StatusNoContent { + somsr, err = client.RefreshResponder(somsr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataRefreshFuture", "Result", somsr.Response.Response, "Failure responding to request") + } + } + return +} + +// IntegrationRuntimeRegenerateKeyParameters parameters to regenerate the authentication key. +type IntegrationRuntimeRegenerateKeyParameters struct { + // KeyName - The name of the authentication key to regenerate. Possible values include: 'AuthKey1', 'AuthKey2' + KeyName IntegrationRuntimeAuthKeyName `json:"keyName,omitempty"` +} + +// IntegrationRuntimeResource integration runtime resource type. +type IntegrationRuntimeResource struct { + autorest.Response `json:"-"` + // Properties - Integration runtime properties. + Properties BasicIntegrationRuntime `json:"properties,omitempty"` + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeResource. +func (irr IntegrationRuntimeResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = irr.Properties + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeResource struct. +func (irr *IntegrationRuntimeResource) 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 { + properties, err := unmarshalBasicIntegrationRuntime(*v) + if err != nil { + return err + } + irr.Properties = properties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + irr.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + irr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + irr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + irr.Type = &typeVar + } + } + } + + return nil +} + +// IntegrationRuntimesCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type IntegrationRuntimesCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IntegrationRuntimesCreateFuture) Result(client IntegrationRuntimesClient) (irr IntegrationRuntimeResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if irr.Response.Response, err = future.GetResult(sender); err == nil && irr.Response.Response.StatusCode != http.StatusNoContent { + irr, err = client.CreateResponder(irr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesCreateFuture", "Result", irr.Response.Response, "Failure responding to request") + } + } + return +} + +// IntegrationRuntimesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type IntegrationRuntimesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IntegrationRuntimesDeleteFuture) Result(client IntegrationRuntimesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// IntegrationRuntimesEnableInteractiveQueryFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type IntegrationRuntimesEnableInteractiveQueryFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IntegrationRuntimesEnableInteractiveQueryFuture) Result(client IntegrationRuntimesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesEnableInteractiveQueryFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimesEnableInteractiveQueryFuture") + return + } + ar.Response = future.Response() + return +} + +// IntegrationRuntimeSsisCatalogInfo catalog information for managed dedicated integration runtime. +type IntegrationRuntimeSsisCatalogInfo struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // CatalogServerEndpoint - The catalog database server URL. + CatalogServerEndpoint *string `json:"catalogServerEndpoint,omitempty"` + // CatalogAdminUserName - The administrator user name of catalog database. + CatalogAdminUserName *string `json:"catalogAdminUserName,omitempty"` + // CatalogAdminPassword - The password of the administrator user account of the catalog database. + CatalogAdminPassword *SecureString `json:"catalogAdminPassword,omitempty"` + // CatalogPricingTier - The pricing tier for the catalog database. The valid values could be found in https://azure.microsoft.com/en-us/pricing/details/sql-database/. Possible values include: 'IntegrationRuntimeSsisCatalogPricingTierBasic', 'IntegrationRuntimeSsisCatalogPricingTierStandard', 'IntegrationRuntimeSsisCatalogPricingTierPremium', 'IntegrationRuntimeSsisCatalogPricingTierPremiumRS' + CatalogPricingTier IntegrationRuntimeSsisCatalogPricingTier `json:"catalogPricingTier,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeSsisCatalogInfo. +func (irsci IntegrationRuntimeSsisCatalogInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if irsci.CatalogServerEndpoint != nil { + objectMap["catalogServerEndpoint"] = irsci.CatalogServerEndpoint + } + if irsci.CatalogAdminUserName != nil { + objectMap["catalogAdminUserName"] = irsci.CatalogAdminUserName + } + if irsci.CatalogAdminPassword != nil { + objectMap["catalogAdminPassword"] = irsci.CatalogAdminPassword + } + if irsci.CatalogPricingTier != "" { + objectMap["catalogPricingTier"] = irsci.CatalogPricingTier + } + for k, v := range irsci.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeSsisCatalogInfo struct. +func (irsci *IntegrationRuntimeSsisCatalogInfo) 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 { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if irsci.AdditionalProperties == nil { + irsci.AdditionalProperties = make(map[string]interface{}) + } + irsci.AdditionalProperties[k] = additionalProperties + } + case "catalogServerEndpoint": + if v != nil { + var catalogServerEndpoint string + err = json.Unmarshal(*v, &catalogServerEndpoint) + if err != nil { + return err + } + irsci.CatalogServerEndpoint = &catalogServerEndpoint + } + case "catalogAdminUserName": + if v != nil { + var catalogAdminUserName string + err = json.Unmarshal(*v, &catalogAdminUserName) + if err != nil { + return err + } + irsci.CatalogAdminUserName = &catalogAdminUserName + } + case "catalogAdminPassword": + if v != nil { + var catalogAdminPassword SecureString + err = json.Unmarshal(*v, &catalogAdminPassword) + if err != nil { + return err + } + irsci.CatalogAdminPassword = &catalogAdminPassword + } + case "catalogPricingTier": + if v != nil { + var catalogPricingTier IntegrationRuntimeSsisCatalogPricingTier + err = json.Unmarshal(*v, &catalogPricingTier) + if err != nil { + return err + } + irsci.CatalogPricingTier = catalogPricingTier + } + } + } + + return nil +} + +// IntegrationRuntimeSsisProperties SSIS properties for managed integration runtime. +type IntegrationRuntimeSsisProperties struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // CatalogInfo - Catalog information for managed dedicated integration runtime. + CatalogInfo *IntegrationRuntimeSsisCatalogInfo `json:"catalogInfo,omitempty"` + // LicenseType - License type for bringing your own license scenario. Possible values include: 'BasePrice', 'LicenseIncluded' + LicenseType IntegrationRuntimeLicenseType `json:"licenseType,omitempty"` + // CustomSetupScriptProperties - Custom setup script properties for a managed dedicated integration runtime. + CustomSetupScriptProperties *IntegrationRuntimeCustomSetupScriptProperties `json:"customSetupScriptProperties,omitempty"` + // DataProxyProperties - Data proxy properties for a managed dedicated integration runtime. + DataProxyProperties *IntegrationRuntimeDataProxyProperties `json:"dataProxyProperties,omitempty"` + // Edition - The edition for the SSIS Integration Runtime. Possible values include: 'Standard', 'Enterprise' + Edition IntegrationRuntimeEdition `json:"edition,omitempty"` + // ExpressCustomSetupProperties - Custom setup without script properties for a SSIS integration runtime. + ExpressCustomSetupProperties *[]BasicCustomSetupBase `json:"expressCustomSetupProperties,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeSsisProperties. +func (irsp IntegrationRuntimeSsisProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if irsp.CatalogInfo != nil { + objectMap["catalogInfo"] = irsp.CatalogInfo + } + if irsp.LicenseType != "" { + objectMap["licenseType"] = irsp.LicenseType + } + if irsp.CustomSetupScriptProperties != nil { + objectMap["customSetupScriptProperties"] = irsp.CustomSetupScriptProperties + } + if irsp.DataProxyProperties != nil { + objectMap["dataProxyProperties"] = irsp.DataProxyProperties + } + if irsp.Edition != "" { + objectMap["edition"] = irsp.Edition + } + if irsp.ExpressCustomSetupProperties != nil { + objectMap["expressCustomSetupProperties"] = irsp.ExpressCustomSetupProperties + } + for k, v := range irsp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeSsisProperties struct. +func (irsp *IntegrationRuntimeSsisProperties) 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 { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if irsp.AdditionalProperties == nil { + irsp.AdditionalProperties = make(map[string]interface{}) + } + irsp.AdditionalProperties[k] = additionalProperties + } + case "catalogInfo": + if v != nil { + var catalogInfo IntegrationRuntimeSsisCatalogInfo + err = json.Unmarshal(*v, &catalogInfo) + if err != nil { + return err + } + irsp.CatalogInfo = &catalogInfo + } + case "licenseType": + if v != nil { + var licenseType IntegrationRuntimeLicenseType + err = json.Unmarshal(*v, &licenseType) + if err != nil { + return err + } + irsp.LicenseType = licenseType + } + case "customSetupScriptProperties": + if v != nil { + var customSetupScriptProperties IntegrationRuntimeCustomSetupScriptProperties + err = json.Unmarshal(*v, &customSetupScriptProperties) + if err != nil { + return err + } + irsp.CustomSetupScriptProperties = &customSetupScriptProperties + } + case "dataProxyProperties": + if v != nil { + var dataProxyProperties IntegrationRuntimeDataProxyProperties + err = json.Unmarshal(*v, &dataProxyProperties) + if err != nil { + return err + } + irsp.DataProxyProperties = &dataProxyProperties + } + case "edition": + if v != nil { + var edition IntegrationRuntimeEdition + err = json.Unmarshal(*v, &edition) + if err != nil { + return err + } + irsp.Edition = edition + } + case "expressCustomSetupProperties": + if v != nil { + expressCustomSetupProperties, err := unmarshalBasicCustomSetupBaseArray(*v) + if err != nil { + return err + } + irsp.ExpressCustomSetupProperties = &expressCustomSetupProperties + } + } + } + + return nil +} + +// IntegrationRuntimesStartFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type IntegrationRuntimesStartFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IntegrationRuntimesStartFuture) Result(client IntegrationRuntimesClient) (irsr IntegrationRuntimeStatusResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimesStartFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if irsr.Response.Response, err = future.GetResult(sender); err == nil && irsr.Response.Response.StatusCode != http.StatusNoContent { + irsr, err = client.StartResponder(irsr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesStartFuture", "Result", irsr.Response.Response, "Failure responding to request") + } + } + return +} + +// IntegrationRuntimesStopFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type IntegrationRuntimesStopFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IntegrationRuntimesStopFuture) Result(client IntegrationRuntimesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesStopFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimesStopFuture") + return + } + ar.Response = future.Response() + return +} + +// BasicIntegrationRuntimeStatus integration runtime status. +type BasicIntegrationRuntimeStatus interface { + AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) + AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) + AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) +} + +// IntegrationRuntimeStatus integration runtime status. +type IntegrationRuntimeStatus struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // DataFactoryName - READ-ONLY; The workspace name which the integration runtime belong to. + DataFactoryName *string `json:"dataFactoryName,omitempty"` + // State - READ-ONLY; The state of integration runtime. Possible values include: 'Initial', 'Stopped', 'Started', 'Starting', 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline', 'AccessDenied' + State IntegrationRuntimeState `json:"state,omitempty"` + // Type - Possible values include: 'TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus', 'TypeBasicIntegrationRuntimeStatusTypeManaged', 'TypeBasicIntegrationRuntimeStatusTypeSelfHosted' + Type TypeBasicIntegrationRuntimeStatus `json:"type,omitempty"` +} + +func unmarshalBasicIntegrationRuntimeStatus(body []byte) (BasicIntegrationRuntimeStatus, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeBasicIntegrationRuntimeStatusTypeManaged): + var mirs ManagedIntegrationRuntimeStatus + err := json.Unmarshal(body, &mirs) + return mirs, err + case string(TypeBasicIntegrationRuntimeStatusTypeSelfHosted): + var shirs SelfHostedIntegrationRuntimeStatus + err := json.Unmarshal(body, &shirs) + return shirs, err + default: + var irs IntegrationRuntimeStatus + err := json.Unmarshal(body, &irs) + return irs, err + } +} +func unmarshalBasicIntegrationRuntimeStatusArray(body []byte) ([]BasicIntegrationRuntimeStatus, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + irsArray := make([]BasicIntegrationRuntimeStatus, len(rawMessages)) + + for index, rawMessage := range rawMessages { + irs, err := unmarshalBasicIntegrationRuntimeStatus(*rawMessage) + if err != nil { + return nil, err + } + irsArray[index] = irs + } + return irsArray, nil +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeStatus. +func (irs IntegrationRuntimeStatus) MarshalJSON() ([]byte, error) { + irs.Type = TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus + objectMap := make(map[string]interface{}) + if irs.Type != "" { + objectMap["type"] = irs.Type + } + for k, v := range irs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsManagedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus. +func (irs IntegrationRuntimeStatus) AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) { + return nil, false +} + +// AsSelfHostedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus. +func (irs IntegrationRuntimeStatus) AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) { + return nil, false +} + +// AsIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus. +func (irs IntegrationRuntimeStatus) AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) { + return &irs, true +} + +// AsBasicIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus. +func (irs IntegrationRuntimeStatus) AsBasicIntegrationRuntimeStatus() (BasicIntegrationRuntimeStatus, bool) { + return &irs, true +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeStatus struct. +func (irs *IntegrationRuntimeStatus) 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 { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if irs.AdditionalProperties == nil { + irs.AdditionalProperties = make(map[string]interface{}) + } + irs.AdditionalProperties[k] = additionalProperties + } + case "dataFactoryName": + if v != nil { + var dataFactoryName string + err = json.Unmarshal(*v, &dataFactoryName) + if err != nil { + return err + } + irs.DataFactoryName = &dataFactoryName + } + case "state": + if v != nil { + var state IntegrationRuntimeState + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + irs.State = state + } + case "type": + if v != nil { + var typeVar TypeBasicIntegrationRuntimeStatus + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + irs.Type = typeVar + } + } + } + + return nil +} + +// IntegrationRuntimeStatusResponse integration runtime status response. +type IntegrationRuntimeStatusResponse struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; The integration runtime name. + Name *string `json:"name,omitempty"` + // Properties - Integration runtime properties. + Properties BasicIntegrationRuntimeStatus `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeStatusResponse. +func (irsr IntegrationRuntimeStatusResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = irsr.Properties + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeStatusResponse struct. +func (irsr *IntegrationRuntimeStatusResponse) 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 "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + irsr.Name = &name + } + case "properties": + if v != nil { + properties, err := unmarshalBasicIntegrationRuntimeStatus(*v) + if err != nil { + return err + } + irsr.Properties = properties + } + } + } + + return nil +} + +// IntegrationRuntimeVNetProperties vNet properties for managed integration runtime. +type IntegrationRuntimeVNetProperties struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // VNetID - The ID of the VNet that this integration runtime will join. + VNetID *string `json:"vNetId,omitempty"` + // Subnet - The name of the subnet this integration runtime will join. + Subnet *string `json:"subnet,omitempty"` + // PublicIPs - Resource IDs of the public IP addresses that this integration runtime will use. + PublicIPs *[]string `json:"publicIPs,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeVNetProperties. +func (irvnp IntegrationRuntimeVNetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if irvnp.VNetID != nil { + objectMap["vNetId"] = irvnp.VNetID + } + if irvnp.Subnet != nil { + objectMap["subnet"] = irvnp.Subnet + } + if irvnp.PublicIPs != nil { + objectMap["publicIPs"] = irvnp.PublicIPs + } + for k, v := range irvnp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeVNetProperties struct. +func (irvnp *IntegrationRuntimeVNetProperties) 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 { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if irvnp.AdditionalProperties == nil { + irvnp.AdditionalProperties = make(map[string]interface{}) + } + irvnp.AdditionalProperties[k] = additionalProperties + } + case "vNetId": + if v != nil { + var vNetID string + err = json.Unmarshal(*v, &vNetID) + if err != nil { + return err + } + irvnp.VNetID = &vNetID + } + case "subnet": + if v != nil { + var subnet string + err = json.Unmarshal(*v, &subnet) + if err != nil { + return err + } + irvnp.Subnet = &subnet + } + case "publicIPs": + if v != nil { + var publicIPs []string + err = json.Unmarshal(*v, &publicIPs) + if err != nil { + return err + } + irvnp.PublicIPs = &publicIPs + } + } + } + + return nil +} + +// IPFirewallRuleInfo IP firewall rule +type IPFirewallRuleInfo struct { + autorest.Response `json:"-"` + // IPFirewallRuleProperties - IP firewall rule properties + *IPFirewallRuleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IPFirewallRuleInfo. +func (ifri IPFirewallRuleInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ifri.IPFirewallRuleProperties != nil { + objectMap["properties"] = ifri.IPFirewallRuleProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IPFirewallRuleInfo struct. +func (ifri *IPFirewallRuleInfo) 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 IPFirewallRuleProperties IPFirewallRuleProperties + err = json.Unmarshal(*v, &IPFirewallRuleProperties) + if err != nil { + return err + } + ifri.IPFirewallRuleProperties = &IPFirewallRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ifri.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ifri.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ifri.Type = &typeVar + } + } + } + + return nil +} + +// IPFirewallRuleInfoListResult list of IP firewall rules +type IPFirewallRuleInfoListResult struct { + autorest.Response `json:"-"` + // NextLink - Link to next page of results + NextLink *string `json:"nextLink,omitempty"` + // Value - List of IP firewall rules + Value *[]IPFirewallRuleInfo `json:"value,omitempty"` +} + +// IPFirewallRuleInfoListResultIterator provides access to a complete listing of IPFirewallRuleInfo values. +type IPFirewallRuleInfoListResultIterator struct { + i int + page IPFirewallRuleInfoListResultPage +} + +// 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 *IPFirewallRuleInfoListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IPFirewallRuleInfoListResultIterator.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 *IPFirewallRuleInfoListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IPFirewallRuleInfoListResultIterator) 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 IPFirewallRuleInfoListResultIterator) Response() IPFirewallRuleInfoListResult { + 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 IPFirewallRuleInfoListResultIterator) Value() IPFirewallRuleInfo { + if !iter.page.NotDone() { + return IPFirewallRuleInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IPFirewallRuleInfoListResultIterator type. +func NewIPFirewallRuleInfoListResultIterator(page IPFirewallRuleInfoListResultPage) IPFirewallRuleInfoListResultIterator { + return IPFirewallRuleInfoListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ifrilr IPFirewallRuleInfoListResult) IsEmpty() bool { + return ifrilr.Value == nil || len(*ifrilr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ifrilr IPFirewallRuleInfoListResult) hasNextLink() bool { + return ifrilr.NextLink != nil && len(*ifrilr.NextLink) != 0 +} + +// iPFirewallRuleInfoListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ifrilr IPFirewallRuleInfoListResult) iPFirewallRuleInfoListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ifrilr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ifrilr.NextLink))) +} + +// IPFirewallRuleInfoListResultPage contains a page of IPFirewallRuleInfo values. +type IPFirewallRuleInfoListResultPage struct { + fn func(context.Context, IPFirewallRuleInfoListResult) (IPFirewallRuleInfoListResult, error) + ifrilr IPFirewallRuleInfoListResult +} + +// 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 *IPFirewallRuleInfoListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IPFirewallRuleInfoListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ifrilr) + if err != nil { + return err + } + page.ifrilr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IPFirewallRuleInfoListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IPFirewallRuleInfoListResultPage) NotDone() bool { + return !page.ifrilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IPFirewallRuleInfoListResultPage) Response() IPFirewallRuleInfoListResult { + return page.ifrilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IPFirewallRuleInfoListResultPage) Values() []IPFirewallRuleInfo { + if page.ifrilr.IsEmpty() { + return nil + } + return *page.ifrilr.Value +} + +// Creates a new instance of the IPFirewallRuleInfoListResultPage type. +func NewIPFirewallRuleInfoListResultPage(cur IPFirewallRuleInfoListResult, getNextPage func(context.Context, IPFirewallRuleInfoListResult) (IPFirewallRuleInfoListResult, error)) IPFirewallRuleInfoListResultPage { + return IPFirewallRuleInfoListResultPage{ + fn: getNextPage, + ifrilr: cur, + } +} + +// IPFirewallRuleProperties IP firewall rule properties +type IPFirewallRuleProperties struct { + // EndIPAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress + EndIPAddress *string `json:"endIpAddress,omitempty"` + // ProvisioningState - READ-ONLY; Resource provisioning state. Possible values include: 'ProvisioningStateProvisioning', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateFailed', 'ProvisioningStateDeleteError' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // StartIPAddress - The start IP address of the firewall rule. Must be IPv4 format + StartIPAddress *string `json:"startIpAddress,omitempty"` +} + +// MarshalJSON is the custom marshaler for IPFirewallRuleProperties. +func (ifrp IPFirewallRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ifrp.EndIPAddress != nil { + objectMap["endIpAddress"] = ifrp.EndIPAddress + } + if ifrp.StartIPAddress != nil { + objectMap["startIpAddress"] = ifrp.StartIPAddress + } + return json.Marshal(objectMap) +} + +// IPFirewallRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type IPFirewallRulesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IPFirewallRulesCreateOrUpdateFuture) Result(client IPFirewallRulesClient) (ifri IPFirewallRuleInfo, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.IPFirewallRulesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ifri.Response.Response, err = future.GetResult(sender); err == nil && ifri.Response.Response.StatusCode != http.StatusNoContent { + ifri, err = client.CreateOrUpdateResponder(ifri.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesCreateOrUpdateFuture", "Result", ifri.Response.Response, "Failure responding to request") + } + } + return +} + +// IPFirewallRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type IPFirewallRulesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IPFirewallRulesDeleteFuture) Result(client IPFirewallRulesClient) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.IPFirewallRulesDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { + so, err = client.DeleteResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesDeleteFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + +// IPFirewallRulesReplaceAllFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type IPFirewallRulesReplaceAllFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IPFirewallRulesReplaceAllFuture) Result(client IPFirewallRulesClient) (rafror ReplaceAllFirewallRulesOperationResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesReplaceAllFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.IPFirewallRulesReplaceAllFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rafror.Response.Response, err = future.GetResult(sender); err == nil && rafror.Response.Response.StatusCode != http.StatusNoContent { + rafror, err = client.ReplaceAllResponder(rafror.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesReplaceAllFuture", "Result", rafror.Response.Response, "Failure responding to request") + } + } + return +} + +// Key a workspace key +type Key struct { + autorest.Response `json:"-"` + // KeyProperties - Keys resource properties + *KeyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Key. +func (kVar Key) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kVar.KeyProperties != nil { + objectMap["properties"] = kVar.KeyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Key struct. +func (kVar *Key) 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 keyProperties KeyProperties + err = json.Unmarshal(*v, &keyProperties) + if err != nil { + return err + } + kVar.KeyProperties = &keyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kVar.Type = &typeVar + } + } + } + + return nil +} + +// KeyInfoListResult list of keys +type KeyInfoListResult struct { + autorest.Response `json:"-"` + // NextLink - Link to the next page of results + NextLink *string `json:"nextLink,omitempty"` + // Value - List of keys + Value *[]Key `json:"value,omitempty"` +} + +// KeyInfoListResultIterator provides access to a complete listing of Key values. +type KeyInfoListResultIterator struct { + i int + page KeyInfoListResultPage +} + +// 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 *KeyInfoListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KeyInfoListResultIterator.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 *KeyInfoListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter KeyInfoListResultIterator) 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 KeyInfoListResultIterator) Response() KeyInfoListResult { + 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 KeyInfoListResultIterator) Value() Key { + if !iter.page.NotDone() { + return Key{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the KeyInfoListResultIterator type. +func NewKeyInfoListResultIterator(page KeyInfoListResultPage) KeyInfoListResultIterator { + return KeyInfoListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (kilr KeyInfoListResult) IsEmpty() bool { + return kilr.Value == nil || len(*kilr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (kilr KeyInfoListResult) hasNextLink() bool { + return kilr.NextLink != nil && len(*kilr.NextLink) != 0 +} + +// keyInfoListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (kilr KeyInfoListResult) keyInfoListResultPreparer(ctx context.Context) (*http.Request, error) { + if !kilr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(kilr.NextLink))) +} + +// KeyInfoListResultPage contains a page of Key values. +type KeyInfoListResultPage struct { + fn func(context.Context, KeyInfoListResult) (KeyInfoListResult, error) + kilr KeyInfoListResult +} + +// 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 *KeyInfoListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KeyInfoListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.kilr) + if err != nil { + return err + } + page.kilr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *KeyInfoListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page KeyInfoListResultPage) NotDone() bool { + return !page.kilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page KeyInfoListResultPage) Response() KeyInfoListResult { + return page.kilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page KeyInfoListResultPage) Values() []Key { + if page.kilr.IsEmpty() { + return nil + } + return *page.kilr.Value +} + +// Creates a new instance of the KeyInfoListResultPage type. +func NewKeyInfoListResultPage(cur KeyInfoListResult, getNextPage func(context.Context, KeyInfoListResult) (KeyInfoListResult, error)) KeyInfoListResultPage { + return KeyInfoListResultPage{ + fn: getNextPage, + kilr: cur, + } +} + +// KeyProperties key properties +type KeyProperties struct { + // IsActiveCMK - Used to activate the workspace after a customer managed key is provided. + IsActiveCMK *bool `json:"isActiveCMK,omitempty"` + // KeyVaultURL - The Key Vault Url of the workspace key. + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` +} + +// LibraryInfo library/package information of a Big Data pool powered by Apache Spark +type LibraryInfo struct { + // Name - Name of the library. + Name *string `json:"name,omitempty"` + // Path - Storage blob path of library. + Path *string `json:"path,omitempty"` + // ContainerName - Storage blob container name. + ContainerName *string `json:"containerName,omitempty"` + // UploadedTimestamp - The last update time of the library. + UploadedTimestamp *date.Time `json:"uploadedTimestamp,omitempty"` + // Type - Type of the library. + Type *string `json:"type,omitempty"` + // ProvisioningStatus - READ-ONLY; Provisioning status of the library/package. + ProvisioningStatus *string `json:"provisioningStatus,omitempty"` + // CreatorID - READ-ONLY; Creator Id of the library/package. + CreatorID *string `json:"creatorId,omitempty"` +} + +// MarshalJSON is the custom marshaler for LibraryInfo. +func (li LibraryInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if li.Name != nil { + objectMap["name"] = li.Name + } + if li.Path != nil { + objectMap["path"] = li.Path + } + if li.ContainerName != nil { + objectMap["containerName"] = li.ContainerName + } + if li.UploadedTimestamp != nil { + objectMap["uploadedTimestamp"] = li.UploadedTimestamp + } + if li.Type != nil { + objectMap["type"] = li.Type + } + return json.Marshal(objectMap) +} + +// LibraryRequirements library requirements for a Big Data pool powered by Apache Spark +type LibraryRequirements struct { + // Time - READ-ONLY; The last update time of the library requirements file. + Time *date.Time `json:"time,omitempty"` + // Content - The library requirements. + Content *string `json:"content,omitempty"` + // Filename - The filename of the library requirements file. + Filename *string `json:"filename,omitempty"` +} + +// MarshalJSON is the custom marshaler for LibraryRequirements. +func (lr LibraryRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lr.Content != nil { + objectMap["content"] = lr.Content + } + if lr.Filename != nil { + objectMap["filename"] = lr.Filename + } + return json.Marshal(objectMap) +} + +// LicensedComponentSetupTypeProperties installation of licensed component setup type properties. +type LicensedComponentSetupTypeProperties struct { + // ComponentName - The name of the 3rd party component. + ComponentName *string `json:"componentName,omitempty"` + // LicenseKey - The license key to activate the component. + LicenseKey BasicSecretBase `json:"licenseKey,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for LicensedComponentSetupTypeProperties struct. +func (lcstp *LicensedComponentSetupTypeProperties) 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 "componentName": + if v != nil { + var componentName string + err = json.Unmarshal(*v, &componentName) + if err != nil { + return err + } + lcstp.ComponentName = &componentName + } + case "licenseKey": + if v != nil { + licenseKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + lcstp.LicenseKey = licenseKey + } + } + } + + return nil +} + +// LinkedIntegrationRuntime the linked integration runtime information. +type LinkedIntegrationRuntime struct { + // Name - READ-ONLY; The name of the linked integration runtime. + Name *string `json:"name,omitempty"` + // SubscriptionID - READ-ONLY; The subscription ID for which the linked integration runtime belong to. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // DataFactoryName - READ-ONLY; The name of the workspace for which the linked integration runtime belong to. + DataFactoryName *string `json:"dataFactoryName,omitempty"` + // DataFactoryLocation - READ-ONLY; The location of the workspace for which the linked integration runtime belong to. + DataFactoryLocation *string `json:"dataFactoryLocation,omitempty"` + // CreateTime - READ-ONLY; The creating time of the linked integration runtime. + CreateTime *date.Time `json:"createTime,omitempty"` +} + +// LinkedIntegrationRuntimeKeyAuthorization the key authorization type integration runtime. +type LinkedIntegrationRuntimeKeyAuthorization struct { + // Key - The key used for authorization. + Key *SecureString `json:"key,omitempty"` + // AuthorizationType - Possible values include: 'AuthorizationTypeLinkedIntegrationRuntimeType', 'AuthorizationTypeKey', 'AuthorizationTypeRBAC' + AuthorizationType AuthorizationType `json:"authorizationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for LinkedIntegrationRuntimeKeyAuthorization. +func (lirka LinkedIntegrationRuntimeKeyAuthorization) MarshalJSON() ([]byte, error) { + lirka.AuthorizationType = AuthorizationTypeKey + objectMap := make(map[string]interface{}) + if lirka.Key != nil { + objectMap["key"] = lirka.Key + } + if lirka.AuthorizationType != "" { + objectMap["authorizationType"] = lirka.AuthorizationType + } + return json.Marshal(objectMap) +} + +// AsLinkedIntegrationRuntimeKeyAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeKeyAuthorization. +func (lirka LinkedIntegrationRuntimeKeyAuthorization) AsLinkedIntegrationRuntimeKeyAuthorization() (*LinkedIntegrationRuntimeKeyAuthorization, bool) { + return &lirka, true +} + +// AsLinkedIntegrationRuntimeRbacAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeKeyAuthorization. +func (lirka LinkedIntegrationRuntimeKeyAuthorization) AsLinkedIntegrationRuntimeRbacAuthorization() (*LinkedIntegrationRuntimeRbacAuthorization, bool) { + return nil, false +} + +// AsLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeKeyAuthorization. +func (lirka LinkedIntegrationRuntimeKeyAuthorization) AsLinkedIntegrationRuntimeType() (*LinkedIntegrationRuntimeType, bool) { + return nil, false +} + +// AsBasicLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeKeyAuthorization. +func (lirka LinkedIntegrationRuntimeKeyAuthorization) AsBasicLinkedIntegrationRuntimeType() (BasicLinkedIntegrationRuntimeType, bool) { + return &lirka, true +} + +// LinkedIntegrationRuntimeRbacAuthorization the role based access control (RBAC) authorization type +// integration runtime. +type LinkedIntegrationRuntimeRbacAuthorization struct { + // ResourceID - The resource identifier of the integration runtime to be shared. + ResourceID *string `json:"resourceId,omitempty"` + // AuthorizationType - Possible values include: 'AuthorizationTypeLinkedIntegrationRuntimeType', 'AuthorizationTypeKey', 'AuthorizationTypeRBAC' + AuthorizationType AuthorizationType `json:"authorizationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for LinkedIntegrationRuntimeRbacAuthorization. +func (lirra LinkedIntegrationRuntimeRbacAuthorization) MarshalJSON() ([]byte, error) { + lirra.AuthorizationType = AuthorizationTypeRBAC + objectMap := make(map[string]interface{}) + if lirra.ResourceID != nil { + objectMap["resourceId"] = lirra.ResourceID + } + if lirra.AuthorizationType != "" { + objectMap["authorizationType"] = lirra.AuthorizationType + } + return json.Marshal(objectMap) +} + +// AsLinkedIntegrationRuntimeKeyAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeRbacAuthorization. +func (lirra LinkedIntegrationRuntimeRbacAuthorization) AsLinkedIntegrationRuntimeKeyAuthorization() (*LinkedIntegrationRuntimeKeyAuthorization, bool) { + return nil, false +} + +// AsLinkedIntegrationRuntimeRbacAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeRbacAuthorization. +func (lirra LinkedIntegrationRuntimeRbacAuthorization) AsLinkedIntegrationRuntimeRbacAuthorization() (*LinkedIntegrationRuntimeRbacAuthorization, bool) { + return &lirra, true +} + +// AsLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeRbacAuthorization. +func (lirra LinkedIntegrationRuntimeRbacAuthorization) AsLinkedIntegrationRuntimeType() (*LinkedIntegrationRuntimeType, bool) { + return nil, false +} + +// AsBasicLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeRbacAuthorization. +func (lirra LinkedIntegrationRuntimeRbacAuthorization) AsBasicLinkedIntegrationRuntimeType() (BasicLinkedIntegrationRuntimeType, bool) { + return &lirra, true +} + +// BasicLinkedIntegrationRuntimeType the base definition of a linked integration runtime. +type BasicLinkedIntegrationRuntimeType interface { + AsLinkedIntegrationRuntimeKeyAuthorization() (*LinkedIntegrationRuntimeKeyAuthorization, bool) + AsLinkedIntegrationRuntimeRbacAuthorization() (*LinkedIntegrationRuntimeRbacAuthorization, bool) + AsLinkedIntegrationRuntimeType() (*LinkedIntegrationRuntimeType, bool) +} + +// LinkedIntegrationRuntimeType the base definition of a linked integration runtime. +type LinkedIntegrationRuntimeType struct { + // AuthorizationType - Possible values include: 'AuthorizationTypeLinkedIntegrationRuntimeType', 'AuthorizationTypeKey', 'AuthorizationTypeRBAC' + AuthorizationType AuthorizationType `json:"authorizationType,omitempty"` +} + +func unmarshalBasicLinkedIntegrationRuntimeType(body []byte) (BasicLinkedIntegrationRuntimeType, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["authorizationType"] { + case string(AuthorizationTypeKey): + var lirka LinkedIntegrationRuntimeKeyAuthorization + err := json.Unmarshal(body, &lirka) + return lirka, err + case string(AuthorizationTypeRBAC): + var lirra LinkedIntegrationRuntimeRbacAuthorization + err := json.Unmarshal(body, &lirra) + return lirra, err + default: + var lirt LinkedIntegrationRuntimeType + err := json.Unmarshal(body, &lirt) + return lirt, err + } +} +func unmarshalBasicLinkedIntegrationRuntimeTypeArray(body []byte) ([]BasicLinkedIntegrationRuntimeType, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + lirtArray := make([]BasicLinkedIntegrationRuntimeType, len(rawMessages)) + + for index, rawMessage := range rawMessages { + lirt, err := unmarshalBasicLinkedIntegrationRuntimeType(*rawMessage) + if err != nil { + return nil, err + } + lirtArray[index] = lirt + } + return lirtArray, nil +} + +// MarshalJSON is the custom marshaler for LinkedIntegrationRuntimeType. +func (lirt LinkedIntegrationRuntimeType) MarshalJSON() ([]byte, error) { + lirt.AuthorizationType = AuthorizationTypeLinkedIntegrationRuntimeType + objectMap := make(map[string]interface{}) + if lirt.AuthorizationType != "" { + objectMap["authorizationType"] = lirt.AuthorizationType + } + return json.Marshal(objectMap) +} + +// AsLinkedIntegrationRuntimeKeyAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeType. +func (lirt LinkedIntegrationRuntimeType) AsLinkedIntegrationRuntimeKeyAuthorization() (*LinkedIntegrationRuntimeKeyAuthorization, bool) { + return nil, false +} + +// AsLinkedIntegrationRuntimeRbacAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeType. +func (lirt LinkedIntegrationRuntimeType) AsLinkedIntegrationRuntimeRbacAuthorization() (*LinkedIntegrationRuntimeRbacAuthorization, bool) { + return nil, false +} + +// AsLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeType. +func (lirt LinkedIntegrationRuntimeType) AsLinkedIntegrationRuntimeType() (*LinkedIntegrationRuntimeType, bool) { + return &lirt, true +} + +// AsBasicLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeType. +func (lirt LinkedIntegrationRuntimeType) AsBasicLinkedIntegrationRuntimeType() (BasicLinkedIntegrationRuntimeType, bool) { + return &lirt, true +} + +// ListAvailableRpOperation ... +type ListAvailableRpOperation struct { + autorest.Response `json:"-"` + Value *[]AvailableRpOperation `json:"value,omitempty"` +} + +// ListSQLPoolSecurityAlertPolicies a list of SQL pool security alert policies. +type ListSQLPoolSecurityAlertPolicies struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]SQLPoolSecurityAlertPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListSQLPoolSecurityAlertPoliciesIterator provides access to a complete listing of +// SQLPoolSecurityAlertPolicy values. +type ListSQLPoolSecurityAlertPoliciesIterator struct { + i int + page ListSQLPoolSecurityAlertPoliciesPage +} + +// 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 *ListSQLPoolSecurityAlertPoliciesIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListSQLPoolSecurityAlertPoliciesIterator.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 *ListSQLPoolSecurityAlertPoliciesIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListSQLPoolSecurityAlertPoliciesIterator) 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 ListSQLPoolSecurityAlertPoliciesIterator) Response() ListSQLPoolSecurityAlertPolicies { + 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 ListSQLPoolSecurityAlertPoliciesIterator) Value() SQLPoolSecurityAlertPolicy { + if !iter.page.NotDone() { + return SQLPoolSecurityAlertPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListSQLPoolSecurityAlertPoliciesIterator type. +func NewListSQLPoolSecurityAlertPoliciesIterator(page ListSQLPoolSecurityAlertPoliciesPage) ListSQLPoolSecurityAlertPoliciesIterator { + return ListSQLPoolSecurityAlertPoliciesIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lspsap ListSQLPoolSecurityAlertPolicies) IsEmpty() bool { + return lspsap.Value == nil || len(*lspsap.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lspsap ListSQLPoolSecurityAlertPolicies) hasNextLink() bool { + return lspsap.NextLink != nil && len(*lspsap.NextLink) != 0 +} + +// listSQLPoolSecurityAlertPoliciesPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lspsap ListSQLPoolSecurityAlertPolicies) listSQLPoolSecurityAlertPoliciesPreparer(ctx context.Context) (*http.Request, error) { + if !lspsap.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lspsap.NextLink))) +} + +// ListSQLPoolSecurityAlertPoliciesPage contains a page of SQLPoolSecurityAlertPolicy values. +type ListSQLPoolSecurityAlertPoliciesPage struct { + fn func(context.Context, ListSQLPoolSecurityAlertPolicies) (ListSQLPoolSecurityAlertPolicies, error) + lspsap ListSQLPoolSecurityAlertPolicies +} + +// 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 *ListSQLPoolSecurityAlertPoliciesPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListSQLPoolSecurityAlertPoliciesPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lspsap) + if err != nil { + return err + } + page.lspsap = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListSQLPoolSecurityAlertPoliciesPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListSQLPoolSecurityAlertPoliciesPage) NotDone() bool { + return !page.lspsap.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListSQLPoolSecurityAlertPoliciesPage) Response() ListSQLPoolSecurityAlertPolicies { + return page.lspsap +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListSQLPoolSecurityAlertPoliciesPage) Values() []SQLPoolSecurityAlertPolicy { + if page.lspsap.IsEmpty() { + return nil + } + return *page.lspsap.Value +} + +// Creates a new instance of the ListSQLPoolSecurityAlertPoliciesPage type. +func NewListSQLPoolSecurityAlertPoliciesPage(cur ListSQLPoolSecurityAlertPolicies, getNextPage func(context.Context, ListSQLPoolSecurityAlertPolicies) (ListSQLPoolSecurityAlertPolicies, error)) ListSQLPoolSecurityAlertPoliciesPage { + return ListSQLPoolSecurityAlertPoliciesPage{ + fn: getNextPage, + lspsap: cur, + } +} + +// ManagedIdentity the workspace managed identity +type ManagedIdentity struct { + // PrincipalID - READ-ONLY; The principal ID of the workspace managed identity + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant ID of the workspace managed identity + TenantID *uuid.UUID `json:"tenantId,omitempty"` + // Type - The type of managed identity for the workspace. Possible values include: 'ResourceIdentityTypeNone', 'ResourceIdentityTypeSystemAssigned' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedIdentity. +func (mi ManagedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mi.Type != "" { + objectMap["type"] = mi.Type + } + return json.Marshal(objectMap) +} + +// ManagedIdentitySQLControlSettingsModel sql Control Settings for workspace managed identity +type ManagedIdentitySQLControlSettingsModel struct { + autorest.Response `json:"-"` + // ManagedIdentitySQLControlSettingsModelProperties - Sql Control Settings for workspace managed identity + *ManagedIdentitySQLControlSettingsModelProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedIdentitySQLControlSettingsModel. +func (miscsm ManagedIdentitySQLControlSettingsModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if miscsm.ManagedIdentitySQLControlSettingsModelProperties != nil { + objectMap["properties"] = miscsm.ManagedIdentitySQLControlSettingsModelProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedIdentitySQLControlSettingsModel struct. +func (miscsm *ManagedIdentitySQLControlSettingsModel) 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 managedIdentitySQLControlSettingsModelProperties ManagedIdentitySQLControlSettingsModelProperties + err = json.Unmarshal(*v, &managedIdentitySQLControlSettingsModelProperties) + if err != nil { + return err + } + miscsm.ManagedIdentitySQLControlSettingsModelProperties = &managedIdentitySQLControlSettingsModelProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + miscsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + miscsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + miscsm.Type = &typeVar + } + } + } + + return nil +} + +// ManagedIdentitySQLControlSettingsModelProperties sql Control Settings for workspace managed identity +type ManagedIdentitySQLControlSettingsModelProperties struct { + // GrantSQLControlToManagedIdentity - Grant sql control to managed identity + GrantSQLControlToManagedIdentity *ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity `json:"grantSqlControlToManagedIdentity,omitempty"` +} + +// ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity grant sql control to +// managed identity +type ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity struct { + // DesiredState - Desired state. Possible values include: 'DesiredStateEnabled', 'DesiredStateDisabled' + DesiredState DesiredState `json:"desiredState,omitempty"` + // ActualState - READ-ONLY; Actual state. Possible values include: 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Unknown' + ActualState ActualState `json:"actualState,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity. +func (miscsmSctmi ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if miscsmSctmi.DesiredState != "" { + objectMap["desiredState"] = miscsmSctmi.DesiredState + } + return json.Marshal(objectMap) +} + +// ManagedIntegrationRuntime managed integration runtime, including managed elastic and managed dedicated +// integration runtimes. +type ManagedIntegrationRuntime struct { + // State - READ-ONLY; Integration runtime state, only valid for managed dedicated integration runtime. Possible values include: 'Initial', 'Stopped', 'Started', 'Starting', 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline', 'AccessDenied' + State IntegrationRuntimeState `json:"state,omitempty"` + // ManagedIntegrationRuntimeTypeProperties - Managed integration runtime properties. + *ManagedIntegrationRuntimeTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Integration runtime description. + Description *string `json:"description,omitempty"` + // Type - Possible values include: 'TypeIntegrationRuntime', 'TypeManaged', 'TypeSelfHosted' + Type Type `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedIntegrationRuntime. +func (mir ManagedIntegrationRuntime) MarshalJSON() ([]byte, error) { + mir.Type = TypeManaged + objectMap := make(map[string]interface{}) + if mir.ManagedIntegrationRuntimeTypeProperties != nil { + objectMap["typeProperties"] = mir.ManagedIntegrationRuntimeTypeProperties + } + if mir.Description != nil { + objectMap["description"] = mir.Description + } + if mir.Type != "" { + objectMap["type"] = mir.Type + } + for k, v := range mir.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsManagedIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime. +func (mir ManagedIntegrationRuntime) AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) { + return &mir, true +} + +// AsSelfHostedIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime. +func (mir ManagedIntegrationRuntime) AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) { + return nil, false +} + +// AsIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime. +func (mir ManagedIntegrationRuntime) AsIntegrationRuntime() (*IntegrationRuntime, bool) { + return nil, false +} + +// AsBasicIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime. +func (mir ManagedIntegrationRuntime) AsBasicIntegrationRuntime() (BasicIntegrationRuntime, bool) { + return &mir, true +} + +// UnmarshalJSON is the custom unmarshaler for ManagedIntegrationRuntime struct. +func (mir *ManagedIntegrationRuntime) 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 "state": + if v != nil { + var state IntegrationRuntimeState + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + mir.State = state + } + case "typeProperties": + if v != nil { + var managedIntegrationRuntimeTypeProperties ManagedIntegrationRuntimeTypeProperties + err = json.Unmarshal(*v, &managedIntegrationRuntimeTypeProperties) + if err != nil { + return err + } + mir.ManagedIntegrationRuntimeTypeProperties = &managedIntegrationRuntimeTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if mir.AdditionalProperties == nil { + mir.AdditionalProperties = make(map[string]interface{}) + } + mir.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + mir.Description = &description + } + case "type": + if v != nil { + var typeVar Type + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mir.Type = typeVar + } + } + } + + return nil +} + +// ManagedIntegrationRuntimeError error definition for managed integration runtime. +type ManagedIntegrationRuntimeError struct { + // Time - READ-ONLY; The time when the error occurred. + Time *date.Time `json:"time,omitempty"` + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Parameters - READ-ONLY; Managed integration runtime error parameters. + Parameters *[]string `json:"parameters,omitempty"` + // Message - READ-ONLY; Error message. + Message *string `json:"message,omitempty"` +} + +// ManagedIntegrationRuntimeNode properties of integration runtime node. +type ManagedIntegrationRuntimeNode struct { + // NodeID - READ-ONLY; The managed integration runtime node id. + NodeID *string `json:"nodeId,omitempty"` + // Status - READ-ONLY; The managed integration runtime node status. Possible values include: 'ManagedIntegrationRuntimeNodeStatusStarting', 'ManagedIntegrationRuntimeNodeStatusAvailable', 'ManagedIntegrationRuntimeNodeStatusRecycling', 'ManagedIntegrationRuntimeNodeStatusUnavailable' + Status ManagedIntegrationRuntimeNodeStatus `json:"status,omitempty"` + // Errors - The errors that occurred on this integration runtime node. + Errors *[]ManagedIntegrationRuntimeError `json:"errors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedIntegrationRuntimeNode. +func (mirn ManagedIntegrationRuntimeNode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mirn.Errors != nil { + objectMap["errors"] = mirn.Errors + } + return json.Marshal(objectMap) +} + +// ManagedIntegrationRuntimeOperationResult properties of managed integration runtime operation result. +type ManagedIntegrationRuntimeOperationResult struct { + // Type - READ-ONLY; The operation type. Could be start or stop. + Type *string `json:"type,omitempty"` + // StartTime - READ-ONLY; The start time of the operation. + StartTime *date.Time `json:"startTime,omitempty"` + // Result - READ-ONLY; The operation result. + Result *string `json:"result,omitempty"` + // ErrorCode - READ-ONLY; The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // Parameters - READ-ONLY; Managed integration runtime error parameters. + Parameters *[]string `json:"parameters,omitempty"` + // ActivityID - READ-ONLY; The activity id for the operation request. + ActivityID *string `json:"activityId,omitempty"` +} + +// ManagedIntegrationRuntimeStatus managed integration runtime status. +type ManagedIntegrationRuntimeStatus struct { + // ManagedIntegrationRuntimeStatusTypeProperties - Managed integration runtime status type properties. + *ManagedIntegrationRuntimeStatusTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // DataFactoryName - READ-ONLY; The workspace name which the integration runtime belong to. + DataFactoryName *string `json:"dataFactoryName,omitempty"` + // State - READ-ONLY; The state of integration runtime. Possible values include: 'Initial', 'Stopped', 'Started', 'Starting', 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline', 'AccessDenied' + State IntegrationRuntimeState `json:"state,omitempty"` + // Type - Possible values include: 'TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus', 'TypeBasicIntegrationRuntimeStatusTypeManaged', 'TypeBasicIntegrationRuntimeStatusTypeSelfHosted' + Type TypeBasicIntegrationRuntimeStatus `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedIntegrationRuntimeStatus. +func (mirs ManagedIntegrationRuntimeStatus) MarshalJSON() ([]byte, error) { + mirs.Type = TypeBasicIntegrationRuntimeStatusTypeManaged + objectMap := make(map[string]interface{}) + if mirs.ManagedIntegrationRuntimeStatusTypeProperties != nil { + objectMap["typeProperties"] = mirs.ManagedIntegrationRuntimeStatusTypeProperties + } + if mirs.Type != "" { + objectMap["type"] = mirs.Type + } + for k, v := range mirs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsManagedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus. +func (mirs ManagedIntegrationRuntimeStatus) AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) { + return &mirs, true +} + +// AsSelfHostedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus. +func (mirs ManagedIntegrationRuntimeStatus) AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) { + return nil, false +} + +// AsIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus. +func (mirs ManagedIntegrationRuntimeStatus) AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) { + return nil, false +} + +// AsBasicIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus. +func (mirs ManagedIntegrationRuntimeStatus) AsBasicIntegrationRuntimeStatus() (BasicIntegrationRuntimeStatus, bool) { + return &mirs, true +} + +// UnmarshalJSON is the custom unmarshaler for ManagedIntegrationRuntimeStatus struct. +func (mirs *ManagedIntegrationRuntimeStatus) 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 "typeProperties": + if v != nil { + var managedIntegrationRuntimeStatusTypeProperties ManagedIntegrationRuntimeStatusTypeProperties + err = json.Unmarshal(*v, &managedIntegrationRuntimeStatusTypeProperties) + if err != nil { + return err + } + mirs.ManagedIntegrationRuntimeStatusTypeProperties = &managedIntegrationRuntimeStatusTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if mirs.AdditionalProperties == nil { + mirs.AdditionalProperties = make(map[string]interface{}) + } + mirs.AdditionalProperties[k] = additionalProperties + } + case "dataFactoryName": + if v != nil { + var dataFactoryName string + err = json.Unmarshal(*v, &dataFactoryName) + if err != nil { + return err + } + mirs.DataFactoryName = &dataFactoryName + } + case "state": + if v != nil { + var state IntegrationRuntimeState + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + mirs.State = state + } + case "type": + if v != nil { + var typeVar TypeBasicIntegrationRuntimeStatus + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mirs.Type = typeVar + } + } + } + + return nil +} + +// ManagedIntegrationRuntimeStatusTypeProperties managed integration runtime status type properties. +type ManagedIntegrationRuntimeStatusTypeProperties struct { + // CreateTime - READ-ONLY; The time at which the integration runtime was created, in ISO8601 format. + CreateTime *date.Time `json:"createTime,omitempty"` + // Nodes - READ-ONLY; The list of nodes for managed integration runtime. + Nodes *[]ManagedIntegrationRuntimeNode `json:"nodes,omitempty"` + // OtherErrors - READ-ONLY; The errors that occurred on this integration runtime. + OtherErrors *[]ManagedIntegrationRuntimeError `json:"otherErrors,omitempty"` + // LastOperation - READ-ONLY; The last operation result that occurred on this integration runtime. + LastOperation *ManagedIntegrationRuntimeOperationResult `json:"lastOperation,omitempty"` +} + +// ManagedIntegrationRuntimeTypeProperties managed integration runtime type properties. +type ManagedIntegrationRuntimeTypeProperties struct { + // ComputeProperties - The compute resource for managed integration runtime. + ComputeProperties *IntegrationRuntimeComputeProperties `json:"computeProperties,omitempty"` + // SsisProperties - SSIS properties for managed integration runtime. + SsisProperties *IntegrationRuntimeSsisProperties `json:"ssisProperties,omitempty"` +} + +// ManagedVirtualNetworkSettings managed Virtual Network Settings +type ManagedVirtualNetworkSettings struct { + // PreventDataExfiltration - Prevent Data Exfiltration + PreventDataExfiltration *bool `json:"preventDataExfiltration,omitempty"` + // LinkedAccessCheckOnTargetResource - Linked Access Check On Target Resource + LinkedAccessCheckOnTargetResource *bool `json:"linkedAccessCheckOnTargetResource,omitempty"` + // AllowedAadTenantIdsForLinking - Allowed Aad Tenant Ids For Linking + AllowedAadTenantIdsForLinking *[]string `json:"allowedAadTenantIdsForLinking,omitempty"` +} + +// MetadataSyncConfig configuration for metadata sync +type MetadataSyncConfig struct { + autorest.Response `json:"-"` + // MetadataSyncConfigProperties - Metadata Sync Config properties + *MetadataSyncConfigProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MetadataSyncConfig. +func (msc MetadataSyncConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if msc.MetadataSyncConfigProperties != nil { + objectMap["properties"] = msc.MetadataSyncConfigProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MetadataSyncConfig struct. +func (msc *MetadataSyncConfig) 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 metadataSyncConfigProperties MetadataSyncConfigProperties + err = json.Unmarshal(*v, &metadataSyncConfigProperties) + if err != nil { + return err + } + msc.MetadataSyncConfigProperties = &metadataSyncConfigProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + msc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + msc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + msc.Type = &typeVar + } + } + } + + return nil +} + +// MetadataSyncConfigProperties metadata Sync Config properties +type MetadataSyncConfigProperties struct { + // Enabled - Indicates whether the metadata sync is enabled or disabled + Enabled *bool `json:"enabled,omitempty"` + // SyncIntervalInMinutes - The Sync Interval in minutes. + SyncIntervalInMinutes *int32 `json:"syncIntervalInMinutes,omitempty"` +} + +// OperationMetaLogSpecification what is this? +type OperationMetaLogSpecification struct { + // DisplayName - Log display name + DisplayName *string `json:"displayName,omitempty"` + // BlobDuration - Time range the log covers + BlobDuration *string `json:"blobDuration,omitempty"` + // Name - Log unique name + Name *string `json:"name,omitempty"` +} + +// OperationMetaMetricDimensionSpecification what is this? +type OperationMetaMetricDimensionSpecification struct { + // DisplayName - Dimension display name + DisplayName *string `json:"displayName,omitempty"` + // Name - Dimension unique name + Name *string `json:"name,omitempty"` + // ToBeExportedForShoebox - Whether this metric should be exported for Shoebox + ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` +} + +// OperationMetaMetricSpecification what is this? +type OperationMetaMetricSpecification struct { + // SourceMdmNamespace - The source MDM namespace + SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"` + // DisplayName - Metric display name + DisplayName *string `json:"displayName,omitempty"` + // Name - Metric unique name + Name *string `json:"name,omitempty"` + // AggregationType - Metric aggregation type + AggregationType *string `json:"aggregationType,omitempty"` + // DisplayDescription - Metric description + DisplayDescription *string `json:"displayDescription,omitempty"` + // SourceMdmAccount - The source MDM account + SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"` + // EnableRegionalMdmAccount - Whether the regional MDM account is enabled + EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"` + // Unit - Metric units + Unit *string `json:"unit,omitempty"` + // Dimensions - Metric dimensions + Dimensions *[]OperationMetaMetricDimensionSpecification `json:"dimensions,omitempty"` + // SupportsInstanceLevelAggregation - Whether the metric supports instance-level aggregation + SupportsInstanceLevelAggregation *bool `json:"supportsInstanceLevelAggregation,omitempty"` + // MetricFilterPattern - Metric filter + MetricFilterPattern *string `json:"metricFilterPattern,omitempty"` +} + +// OperationMetaPropertyInfo what is this? +type OperationMetaPropertyInfo struct { + // ServiceSpecification - Operation service specification + ServiceSpecification *OperationMetaServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// OperationMetaServiceSpecification what is this? +type OperationMetaServiceSpecification struct { + // MetricSpecifications - Service metric specifications + MetricSpecifications *[]OperationMetaMetricSpecification `json:"metricSpecifications,omitempty"` + // LogSpecifications - Service log specifications + LogSpecifications *[]OperationMetaLogSpecification `json:"logSpecifications,omitempty"` +} + +// OperationResource an operation +type OperationResource struct { + autorest.Response `json:"-"` + // ID - Operation ID + ID *string `json:"id,omitempty"` + // Name - Operation name + Name *string `json:"name,omitempty"` + // Status - Operation status. Possible values include: 'OperationStatusInProgress', 'OperationStatusSucceeded', 'OperationStatusFailed', 'OperationStatusCanceled' + Status OperationStatus `json:"status,omitempty"` + // Properties - Operation properties + Properties interface{} `json:"properties,omitempty"` + // Error - Errors from the operation + Error *ErrorDetail `json:"error,omitempty"` + // StartTime - Operation start time + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Operation start time + EndTime *date.Time `json:"endTime,omitempty"` + // PercentComplete - Completion percentage of the operation + PercentComplete *float64 `json:"percentComplete,omitempty"` +} + +// PrivateEndpoint private endpoint details +type PrivateEndpoint struct { + // ID - READ-ONLY; Resource id of the private endpoint. + ID *string `json:"id,omitempty"` +} + +// PrivateEndpointConnection a private endpoint connection +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // PrivateEndpointConnectionProperties - Private endpoint connection properties. + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pec.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. +func (pec *PrivateEndpointConnection) 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 privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pec.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + } + } + + return nil +} + +// PrivateEndpointConnectionForPrivateLinkHub ... +type PrivateEndpointConnectionForPrivateLinkHub struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; identifier + ID *string `json:"id,omitempty"` + // PrivateEndpointConnectionProperties - Properties of private endpoint connection for private link hub + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionForPrivateLinkHub. +func (pecfplh PrivateEndpointConnectionForPrivateLinkHub) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecfplh.Name != nil { + objectMap["name"] = pecfplh.Name + } + if pecfplh.Type != nil { + objectMap["type"] = pecfplh.Type + } + if pecfplh.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pecfplh.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// PrivateEndpointConnectionForPrivateLinkHubBasic private Endpoint Connection For Private Link Hub - Basic +type PrivateEndpointConnectionForPrivateLinkHubBasic struct { + // ID - READ-ONLY; identifier + ID *string `json:"id,omitempty"` + // PrivateEndpointConnectionProperties - Properties of private endpoint connection for private link hub + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionForPrivateLinkHubBasic. +func (pecfplhb PrivateEndpointConnectionForPrivateLinkHubBasic) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecfplhb.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pecfplhb.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnectionForPrivateLinkHubBasic struct. +func (pecfplhb *PrivateEndpointConnectionForPrivateLinkHubBasic) 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 "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pecfplhb.ID = &ID + } + case "properties": + if v != nil { + var privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pecfplhb.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + } + } + + return nil +} + +// PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse ... +type PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse struct { + autorest.Response `json:"-"` + Value *[]PrivateEndpointConnectionForPrivateLinkHub `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator provides access to a +// complete listing of PrivateEndpointConnectionForPrivateLinkHub values. +type PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator struct { + i int + page PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage +} + +// 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 *PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator.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 *PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator) 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 PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator) Response() PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse { + 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 PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator) Value() PrivateEndpointConnectionForPrivateLinkHub { + if !iter.page.NotDone() { + return PrivateEndpointConnectionForPrivateLinkHub{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator type. +func NewPrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator(page PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage) PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator { + return PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pecfplhRcr PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse) IsEmpty() bool { + return pecfplhRcr.Value == nil || len(*pecfplhRcr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pecfplhRcr PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse) hasNextLink() bool { + return pecfplhRcr.NextLink != nil && len(*pecfplhRcr.NextLink) != 0 +} + +// privateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pecfplhRcr PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse) privateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePreparer(ctx context.Context) (*http.Request, error) { + if !pecfplhRcr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pecfplhRcr.NextLink))) +} + +// PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage contains a page of +// PrivateEndpointConnectionForPrivateLinkHub values. +type PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage struct { + fn func(context.Context, PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse) (PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse, error) + pecfplhrcr PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse +} + +// 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 *PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pecfplhrcr) + if err != nil { + return err + } + page.pecfplhrcr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage) NotDone() bool { + return !page.pecfplhrcr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage) Response() PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse { + return page.pecfplhrcr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage) Values() []PrivateEndpointConnectionForPrivateLinkHub { + if page.pecfplhrcr.IsEmpty() { + return nil + } + return *page.pecfplhrcr.Value +} + +// Creates a new instance of the PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage type. +func NewPrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage(cur PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse, getNextPage func(context.Context, PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse) (PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse, error)) PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage { + return PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage{ + fn: getNextPage, + pecfplhrcr: cur, + } +} + +// PrivateEndpointConnectionList a list of private endpoint connections +type PrivateEndpointConnectionList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]PrivateEndpointConnection `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// PrivateEndpointConnectionListIterator provides access to a complete listing of PrivateEndpointConnection +// values. +type PrivateEndpointConnectionListIterator struct { + i int + page PrivateEndpointConnectionListPage +} + +// 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 *PrivateEndpointConnectionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListIterator.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 *PrivateEndpointConnectionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateEndpointConnectionListIterator) 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 PrivateEndpointConnectionListIterator) Response() PrivateEndpointConnectionList { + 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 PrivateEndpointConnectionListIterator) Value() PrivateEndpointConnection { + if !iter.page.NotDone() { + return PrivateEndpointConnection{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateEndpointConnectionListIterator type. +func NewPrivateEndpointConnectionListIterator(page PrivateEndpointConnectionListPage) PrivateEndpointConnectionListIterator { + return PrivateEndpointConnectionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pecl PrivateEndpointConnectionList) IsEmpty() bool { + return pecl.Value == nil || len(*pecl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pecl PrivateEndpointConnectionList) hasNextLink() bool { + return pecl.NextLink != nil && len(*pecl.NextLink) != 0 +} + +// privateEndpointConnectionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pecl PrivateEndpointConnectionList) privateEndpointConnectionListPreparer(ctx context.Context) (*http.Request, error) { + if !pecl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pecl.NextLink))) +} + +// PrivateEndpointConnectionListPage contains a page of PrivateEndpointConnection values. +type PrivateEndpointConnectionListPage struct { + fn func(context.Context, PrivateEndpointConnectionList) (PrivateEndpointConnectionList, error) + pecl PrivateEndpointConnectionList +} + +// 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 *PrivateEndpointConnectionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pecl) + if err != nil { + return err + } + page.pecl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PrivateEndpointConnectionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateEndpointConnectionListPage) NotDone() bool { + return !page.pecl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateEndpointConnectionListPage) Response() PrivateEndpointConnectionList { + return page.pecl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateEndpointConnectionListPage) Values() []PrivateEndpointConnection { + if page.pecl.IsEmpty() { + return nil + } + return *page.pecl.Value +} + +// Creates a new instance of the PrivateEndpointConnectionListPage type. +func NewPrivateEndpointConnectionListPage(cur PrivateEndpointConnectionList, getNextPage func(context.Context, PrivateEndpointConnectionList) (PrivateEndpointConnectionList, error)) PrivateEndpointConnectionListPage { + return PrivateEndpointConnectionListPage{ + fn: getNextPage, + pecl: cur, + } +} + +// PrivateEndpointConnectionProperties properties of a private endpoint connection. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - The private endpoint which the connection belongs to. + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - Connection state of the private endpoint connection. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the private endpoint connection. + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. +func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecp.PrivateEndpoint != nil { + objectMap["privateEndpoint"] = pecp.PrivateEndpoint + } + if pecp.PrivateLinkServiceConnectionState != nil { + objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState + } + return json.Marshal(objectMap) +} + +// PrivateEndpointConnectionsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PrivateEndpointConnectionsCreateFuture) Result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.PrivateEndpointConnectionsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { + pec, err = client.CreateResponder(pec.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsCreateFuture", "Result", pec.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PrivateEndpointConnectionsDeleteFuture) Result(client PrivateEndpointConnectionsClient) (or OperationResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.PrivateEndpointConnectionsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if or.Response.Response, err = future.GetResult(sender); err == nil && or.Response.Response.StatusCode != http.StatusNoContent { + or, err = client.DeleteResponder(or.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsDeleteFuture", "Result", or.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateLinkHub a privateLinkHub +type PrivateLinkHub struct { + autorest.Response `json:"-"` + // PrivateLinkHubProperties - PrivateLinkHub resource properties + *PrivateLinkHubProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkHub. +func (plh PrivateLinkHub) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plh.PrivateLinkHubProperties != nil { + objectMap["properties"] = plh.PrivateLinkHubProperties + } + if plh.Tags != nil { + objectMap["tags"] = plh.Tags + } + if plh.Location != nil { + objectMap["location"] = plh.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkHub struct. +func (plh *PrivateLinkHub) 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 privateLinkHubProperties PrivateLinkHubProperties + err = json.Unmarshal(*v, &privateLinkHubProperties) + if err != nil { + return err + } + plh.PrivateLinkHubProperties = &privateLinkHubProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + plh.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + plh.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plh.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plh.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plh.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkHubInfoListResult list of privateLinkHubs +type PrivateLinkHubInfoListResult struct { + autorest.Response `json:"-"` + // NextLink - Link to the next page of results + NextLink *string `json:"nextLink,omitempty"` + // Value - List of privateLinkHubs + Value *[]PrivateLinkHub `json:"value,omitempty"` +} + +// PrivateLinkHubInfoListResultIterator provides access to a complete listing of PrivateLinkHub values. +type PrivateLinkHubInfoListResultIterator struct { + i int + page PrivateLinkHubInfoListResultPage +} + +// 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 *PrivateLinkHubInfoListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPFirewallRuleInfoListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubInfoListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -2810,67 +6398,67 @@ func (iter *IPFirewallRuleInfoListResultIterator) NextWithContext(ctx context.Co // 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 *IPFirewallRuleInfoListResultIterator) Next() error { +func (iter *PrivateLinkHubInfoListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IPFirewallRuleInfoListResultIterator) NotDone() bool { +func (iter PrivateLinkHubInfoListResultIterator) 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 IPFirewallRuleInfoListResultIterator) Response() IPFirewallRuleInfoListResult { +func (iter PrivateLinkHubInfoListResultIterator) Response() PrivateLinkHubInfoListResult { 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 IPFirewallRuleInfoListResultIterator) Value() IPFirewallRuleInfo { +func (iter PrivateLinkHubInfoListResultIterator) Value() PrivateLinkHub { if !iter.page.NotDone() { - return IPFirewallRuleInfo{} + return PrivateLinkHub{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the IPFirewallRuleInfoListResultIterator type. -func NewIPFirewallRuleInfoListResultIterator(page IPFirewallRuleInfoListResultPage) IPFirewallRuleInfoListResultIterator { - return IPFirewallRuleInfoListResultIterator{page: page} +// Creates a new instance of the PrivateLinkHubInfoListResultIterator type. +func NewPrivateLinkHubInfoListResultIterator(page PrivateLinkHubInfoListResultPage) PrivateLinkHubInfoListResultIterator { + return PrivateLinkHubInfoListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (ifrilr IPFirewallRuleInfoListResult) IsEmpty() bool { - return ifrilr.Value == nil || len(*ifrilr.Value) == 0 +func (plhilr PrivateLinkHubInfoListResult) IsEmpty() bool { + return plhilr.Value == nil || len(*plhilr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (ifrilr IPFirewallRuleInfoListResult) hasNextLink() bool { - return ifrilr.NextLink != nil && len(*ifrilr.NextLink) != 0 +func (plhilr PrivateLinkHubInfoListResult) hasNextLink() bool { + return plhilr.NextLink != nil && len(*plhilr.NextLink) != 0 } -// iPFirewallRuleInfoListResultPreparer prepares a request to retrieve the next set of results. +// privateLinkHubInfoListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (ifrilr IPFirewallRuleInfoListResult) iPFirewallRuleInfoListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ifrilr.hasNextLink() { +func (plhilr PrivateLinkHubInfoListResult) privateLinkHubInfoListResultPreparer(ctx context.Context) (*http.Request, error) { + if !plhilr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(ifrilr.NextLink))) + autorest.WithBaseURL(to.String(plhilr.NextLink))) } -// IPFirewallRuleInfoListResultPage contains a page of IPFirewallRuleInfo values. -type IPFirewallRuleInfoListResultPage struct { - fn func(context.Context, IPFirewallRuleInfoListResult) (IPFirewallRuleInfoListResult, error) - ifrilr IPFirewallRuleInfoListResult +// PrivateLinkHubInfoListResultPage contains a page of PrivateLinkHub values. +type PrivateLinkHubInfoListResultPage struct { + fn func(context.Context, PrivateLinkHubInfoListResult) (PrivateLinkHubInfoListResult, error) + plhilr PrivateLinkHubInfoListResult } // 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 *IPFirewallRuleInfoListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *PrivateLinkHubInfoListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPFirewallRuleInfoListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubInfoListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -2880,11 +6468,11 @@ func (page *IPFirewallRuleInfoListResultPage) NextWithContext(ctx context.Contex }() } for { - next, err := page.fn(ctx, page.ifrilr) + next, err := page.fn(ctx, page.plhilr) if err != nil { return err } - page.ifrilr = next + page.plhilr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -2895,434 +6483,361 @@ func (page *IPFirewallRuleInfoListResultPage) NextWithContext(ctx context.Contex // 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 *IPFirewallRuleInfoListResultPage) Next() error { +func (page *PrivateLinkHubInfoListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IPFirewallRuleInfoListResultPage) NotDone() bool { - return !page.ifrilr.IsEmpty() +func (page PrivateLinkHubInfoListResultPage) NotDone() bool { + return !page.plhilr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page IPFirewallRuleInfoListResultPage) Response() IPFirewallRuleInfoListResult { - return page.ifrilr +func (page PrivateLinkHubInfoListResultPage) Response() PrivateLinkHubInfoListResult { + return page.plhilr } // Values returns the slice of values for the current page or nil if there are no values. -func (page IPFirewallRuleInfoListResultPage) Values() []IPFirewallRuleInfo { - if page.ifrilr.IsEmpty() { +func (page PrivateLinkHubInfoListResultPage) Values() []PrivateLinkHub { + if page.plhilr.IsEmpty() { return nil } - return *page.ifrilr.Value -} - -// Creates a new instance of the IPFirewallRuleInfoListResultPage type. -func NewIPFirewallRuleInfoListResultPage(getNextPage func(context.Context, IPFirewallRuleInfoListResult) (IPFirewallRuleInfoListResult, error)) IPFirewallRuleInfoListResultPage { - return IPFirewallRuleInfoListResultPage{fn: getNextPage} -} - -// IPFirewallRuleProperties IP firewall rule properties -type IPFirewallRuleProperties struct { - // EndIPAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress - EndIPAddress *string `json:"endIpAddress,omitempty"` - // ProvisioningState - READ-ONLY; Resource provisioning state. Possible values include: 'ProvisioningStateProvisioning', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateFailed', 'ProvisioningStateDeleteError' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // StartIPAddress - The start IP address of the firewall rule. Must be IPv4 format - StartIPAddress *string `json:"startIpAddress,omitempty"` -} - -// MarshalJSON is the custom marshaler for IPFirewallRuleProperties. -func (ifrp IPFirewallRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ifrp.EndIPAddress != nil { - objectMap["endIpAddress"] = ifrp.EndIPAddress - } - if ifrp.StartIPAddress != nil { - objectMap["startIpAddress"] = ifrp.StartIPAddress - } - return json.Marshal(objectMap) -} - -// IPFirewallRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type IPFirewallRulesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *IPFirewallRulesCreateOrUpdateFuture) Result(client IPFirewallRulesClient) (ifri IPFirewallRuleInfo, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("synapse.IPFirewallRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ifri.Response.Response, err = future.GetResult(sender); err == nil && ifri.Response.Response.StatusCode != http.StatusNoContent { - ifri, err = client.CreateOrUpdateResponder(ifri.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesCreateOrUpdateFuture", "Result", ifri.Response.Response, "Failure responding to request") - } - } - return -} - -// IPFirewallRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type IPFirewallRulesDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *IPFirewallRulesDeleteFuture) Result(client IPFirewallRulesClient) (so SetObject, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("synapse.IPFirewallRulesDeleteFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { - so, err = client.DeleteResponder(so.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesDeleteFuture", "Result", so.Response.Response, "Failure responding to request") - } - } - return -} - -// IPFirewallRulesReplaceAllFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type IPFirewallRulesReplaceAllFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *IPFirewallRulesReplaceAllFuture) Result(client IPFirewallRulesClient) (rafror ReplaceAllFirewallRulesOperationResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesReplaceAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("synapse.IPFirewallRulesReplaceAllFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rafror.Response.Response, err = future.GetResult(sender); err == nil && rafror.Response.Response.StatusCode != http.StatusNoContent { - rafror, err = client.ReplaceAllResponder(rafror.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesReplaceAllFuture", "Result", rafror.Response.Response, "Failure responding to request") - } - } - return -} - -// LibraryRequirements library requirements for a Big Data pool powered by Apache Spark -type LibraryRequirements struct { - // Time - READ-ONLY; The last update time of the library requirements file. - Time *date.Time `json:"time,omitempty"` - // Content - The library requirements. - Content *string `json:"content,omitempty"` - // Filename - The filename of the library requirements file. - Filename *string `json:"filename,omitempty"` -} - -// MarshalJSON is the custom marshaler for LibraryRequirements. -func (lr LibraryRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lr.Content != nil { - objectMap["content"] = lr.Content - } - if lr.Filename != nil { - objectMap["filename"] = lr.Filename - } - return json.Marshal(objectMap) -} - -// LicensedComponentSetupTypeProperties installation of licensed component setup type properties. -type LicensedComponentSetupTypeProperties struct { - // ComponentName - The name of the 3rd party component. - ComponentName *string `json:"componentName,omitempty"` - // LicenseKey - The license key to activate the component. - LicenseKey BasicSecretBase `json:"licenseKey,omitempty"` + return *page.plhilr.Value } -// UnmarshalJSON is the custom unmarshaler for LicensedComponentSetupTypeProperties struct. -func (lcstp *LicensedComponentSetupTypeProperties) 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 "componentName": - if v != nil { - var componentName string - err = json.Unmarshal(*v, &componentName) - if err != nil { - return err - } - lcstp.ComponentName = &componentName - } - case "licenseKey": - if v != nil { - licenseKey, err := unmarshalBasicSecretBase(*v) - if err != nil { - return err - } - lcstp.LicenseKey = licenseKey - } - } +// Creates a new instance of the PrivateLinkHubInfoListResultPage type. +func NewPrivateLinkHubInfoListResultPage(cur PrivateLinkHubInfoListResult, getNextPage func(context.Context, PrivateLinkHubInfoListResult) (PrivateLinkHubInfoListResult, error)) PrivateLinkHubInfoListResultPage { + return PrivateLinkHubInfoListResultPage{ + fn: getNextPage, + plhilr: cur, } - - return nil } -// LinkedIntegrationRuntime the linked integration runtime information. -type LinkedIntegrationRuntime struct { - // Name - READ-ONLY; The name of the linked integration runtime. - Name *string `json:"name,omitempty"` - // SubscriptionID - READ-ONLY; The subscription ID for which the linked integration runtime belong to. - SubscriptionID *string `json:"subscriptionId,omitempty"` - // DataFactoryName - READ-ONLY; The name of the workspace for which the linked integration runtime belong to. - DataFactoryName *string `json:"dataFactoryName,omitempty"` - // DataFactoryLocation - READ-ONLY; The location of the workspace for which the linked integration runtime belong to. - DataFactoryLocation *string `json:"dataFactoryLocation,omitempty"` - // CreateTime - READ-ONLY; The creating time of the linked integration runtime. - CreateTime *date.Time `json:"createTime,omitempty"` +// PrivateLinkHubPatchInfo privateLinkHub patch details +type PrivateLinkHubPatchInfo struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` } -// LinkedIntegrationRuntimeKeyAuthorization the key authorization type integration runtime. -type LinkedIntegrationRuntimeKeyAuthorization struct { - // Key - The key used for authorization. - Key *SecureString `json:"key,omitempty"` - // AuthorizationType - Possible values include: 'AuthorizationTypeLinkedIntegrationRuntimeType', 'AuthorizationTypeKey', 'AuthorizationTypeRBAC' - AuthorizationType AuthorizationType `json:"authorizationType,omitempty"` +// MarshalJSON is the custom marshaler for PrivateLinkHubPatchInfo. +func (plhpi PrivateLinkHubPatchInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plhpi.Tags != nil { + objectMap["tags"] = plhpi.Tags + } + return json.Marshal(objectMap) } -// MarshalJSON is the custom marshaler for LinkedIntegrationRuntimeKeyAuthorization. -func (lirka LinkedIntegrationRuntimeKeyAuthorization) MarshalJSON() ([]byte, error) { - lirka.AuthorizationType = AuthorizationTypeKey +// PrivateLinkHubProperties privateLinkHub properties +type PrivateLinkHubProperties struct { + // ProvisioningState - PrivateLinkHub provisioning state + ProvisioningState *string `json:"provisioningState,omitempty"` + // PrivateEndpointConnections - READ-ONLY; List of private endpoint connections + PrivateEndpointConnections *[]PrivateEndpointConnectionForPrivateLinkHubBasic `json:"privateEndpointConnections,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkHubProperties. +func (plhp PrivateLinkHubProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if lirka.Key != nil { - objectMap["key"] = lirka.Key - } - if lirka.AuthorizationType != "" { - objectMap["authorizationType"] = lirka.AuthorizationType + if plhp.ProvisioningState != nil { + objectMap["provisioningState"] = plhp.ProvisioningState } return json.Marshal(objectMap) } -// AsLinkedIntegrationRuntimeKeyAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeKeyAuthorization. -func (lirka LinkedIntegrationRuntimeKeyAuthorization) AsLinkedIntegrationRuntimeKeyAuthorization() (*LinkedIntegrationRuntimeKeyAuthorization, bool) { - return &lirka, true +// PrivateLinkHubsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type PrivateLinkHubsDeleteFuture struct { + azure.Future } -// AsLinkedIntegrationRuntimeRbacAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeKeyAuthorization. -func (lirka LinkedIntegrationRuntimeKeyAuthorization) AsLinkedIntegrationRuntimeRbacAuthorization() (*LinkedIntegrationRuntimeRbacAuthorization, bool) { - return nil, false +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PrivateLinkHubsDeleteFuture) Result(client PrivateLinkHubsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.PrivateLinkHubsDeleteFuture") + return + } + ar.Response = future.Response() + return } -// AsLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeKeyAuthorization. -func (lirka LinkedIntegrationRuntimeKeyAuthorization) AsLinkedIntegrationRuntimeType() (*LinkedIntegrationRuntimeType, bool) { - return nil, false +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + autorest.Response `json:"-"` + // Properties - READ-ONLY; The private link resource properties. + Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` } -// AsBasicLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeKeyAuthorization. -func (lirka LinkedIntegrationRuntimeKeyAuthorization) AsBasicLinkedIntegrationRuntimeType() (BasicLinkedIntegrationRuntimeType, bool) { - return &lirka, true +// PrivateLinkResourceListResult a list of private link resources +type PrivateLinkResourceListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]PrivateLinkResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` } -// LinkedIntegrationRuntimeRbacAuthorization the role based access control (RBAC) authorization type -// integration runtime. -type LinkedIntegrationRuntimeRbacAuthorization struct { - // ResourceID - The resource identifier of the integration runtime to be shared. - ResourceID *string `json:"resourceId,omitempty"` - // AuthorizationType - Possible values include: 'AuthorizationTypeLinkedIntegrationRuntimeType', 'AuthorizationTypeKey', 'AuthorizationTypeRBAC' - AuthorizationType AuthorizationType `json:"authorizationType,omitempty"` +// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource +// values. +type PrivateLinkResourceListResultIterator struct { + i int + page PrivateLinkResourceListResultPage } -// MarshalJSON is the custom marshaler for LinkedIntegrationRuntimeRbacAuthorization. -func (lirra LinkedIntegrationRuntimeRbacAuthorization) MarshalJSON() ([]byte, error) { - lirra.AuthorizationType = AuthorizationTypeRBAC - objectMap := make(map[string]interface{}) - if lirra.ResourceID != nil { - objectMap["resourceId"] = lirra.ResourceID +// 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 *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if lirra.AuthorizationType != "" { - objectMap["authorizationType"] = lirra.AuthorizationType + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil } - return json.Marshal(objectMap) + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil } -// AsLinkedIntegrationRuntimeKeyAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeRbacAuthorization. -func (lirra LinkedIntegrationRuntimeRbacAuthorization) AsLinkedIntegrationRuntimeKeyAuthorization() (*LinkedIntegrationRuntimeKeyAuthorization, bool) { - return nil, false +// 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 *PrivateLinkResourceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// AsLinkedIntegrationRuntimeRbacAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeRbacAuthorization. -func (lirra LinkedIntegrationRuntimeRbacAuthorization) AsLinkedIntegrationRuntimeRbacAuthorization() (*LinkedIntegrationRuntimeRbacAuthorization, bool) { - return &lirra, true +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateLinkResourceListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// AsLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeRbacAuthorization. -func (lirra LinkedIntegrationRuntimeRbacAuthorization) AsLinkedIntegrationRuntimeType() (*LinkedIntegrationRuntimeType, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult { + return iter.page.Response() } -// AsBasicLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeRbacAuthorization. -func (lirra LinkedIntegrationRuntimeRbacAuthorization) AsBasicLinkedIntegrationRuntimeType() (BasicLinkedIntegrationRuntimeType, bool) { - return &lirra, true +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource { + if !iter.page.NotDone() { + return PrivateLinkResource{} + } + return iter.page.Values()[iter.i] } -// BasicLinkedIntegrationRuntimeType the base definition of a linked integration runtime. -type BasicLinkedIntegrationRuntimeType interface { - AsLinkedIntegrationRuntimeKeyAuthorization() (*LinkedIntegrationRuntimeKeyAuthorization, bool) - AsLinkedIntegrationRuntimeRbacAuthorization() (*LinkedIntegrationRuntimeRbacAuthorization, bool) - AsLinkedIntegrationRuntimeType() (*LinkedIntegrationRuntimeType, bool) +// Creates a new instance of the PrivateLinkResourceListResultIterator type. +func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator { + return PrivateLinkResourceListResultIterator{page: page} } -// LinkedIntegrationRuntimeType the base definition of a linked integration runtime. -type LinkedIntegrationRuntimeType struct { - // AuthorizationType - Possible values include: 'AuthorizationTypeLinkedIntegrationRuntimeType', 'AuthorizationTypeKey', 'AuthorizationTypeRBAC' - AuthorizationType AuthorizationType `json:"authorizationType,omitempty"` +// IsEmpty returns true if the ListResult contains no values. +func (plrlr PrivateLinkResourceListResult) IsEmpty() bool { + return plrlr.Value == nil || len(*plrlr.Value) == 0 } -func unmarshalBasicLinkedIntegrationRuntimeType(body []byte) (BasicLinkedIntegrationRuntimeType, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } +// hasNextLink returns true if the NextLink is not empty. +func (plrlr PrivateLinkResourceListResult) hasNextLink() bool { + return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0 +} - switch m["authorizationType"] { - case string(AuthorizationTypeKey): - var lirka LinkedIntegrationRuntimeKeyAuthorization - err := json.Unmarshal(body, &lirka) - return lirka, err - case string(AuthorizationTypeRBAC): - var lirra LinkedIntegrationRuntimeRbacAuthorization - err := json.Unmarshal(body, &lirra) - return lirra, err - default: - var lirt LinkedIntegrationRuntimeType - err := json.Unmarshal(body, &lirt) - return lirt, err +// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) { + if !plrlr.hasNextLink() { + return nil, nil } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plrlr.NextLink))) } -func unmarshalBasicLinkedIntegrationRuntimeTypeArray(body []byte) ([]BasicLinkedIntegrationRuntimeType, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - lirtArray := make([]BasicLinkedIntegrationRuntimeType, len(rawMessages)) +// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values. +type PrivateLinkResourceListResultPage struct { + fn func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error) + plrlr PrivateLinkResourceListResult +} - for index, rawMessage := range rawMessages { - lirt, err := unmarshalBasicLinkedIntegrationRuntimeType(*rawMessage) +// 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 *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.plrlr) if err != nil { - return nil, err + return err + } + page.plrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break } - lirtArray[index] = lirt } - return lirtArray, nil + return nil } -// MarshalJSON is the custom marshaler for LinkedIntegrationRuntimeType. -func (lirt LinkedIntegrationRuntimeType) MarshalJSON() ([]byte, error) { - lirt.AuthorizationType = AuthorizationTypeLinkedIntegrationRuntimeType - objectMap := make(map[string]interface{}) - if lirt.AuthorizationType != "" { - objectMap["authorizationType"] = lirt.AuthorizationType +// 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 *PrivateLinkResourceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateLinkResourceListResultPage) NotDone() bool { + return !page.plrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult { + return page.plrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource { + if page.plrlr.IsEmpty() { + return nil + } + return *page.plrlr.Value +} + +// Creates a new instance of the PrivateLinkResourceListResultPage type. +func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage { + return PrivateLinkResourceListResultPage{ + fn: getNextPage, + plrlr: cur, } - return json.Marshal(objectMap) } -// AsLinkedIntegrationRuntimeKeyAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeType. -func (lirt LinkedIntegrationRuntimeType) AsLinkedIntegrationRuntimeKeyAuthorization() (*LinkedIntegrationRuntimeKeyAuthorization, bool) { - return nil, false +// PrivateLinkResourceProperties properties of a private link resource. +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - READ-ONLY; The private link resource required member names. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - READ-ONLY; Required DNS zone names of the the private link resource. + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` } -// AsLinkedIntegrationRuntimeRbacAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeType. -func (lirt LinkedIntegrationRuntimeType) AsLinkedIntegrationRuntimeRbacAuthorization() (*LinkedIntegrationRuntimeRbacAuthorization, bool) { - return nil, false +// PrivateLinkServiceConnectionState connection state details of the private endpoint +type PrivateLinkServiceConnectionState struct { + // Status - The private link service connection status. + Status *string `json:"status,omitempty"` + // Description - The private link service connection description. + Description *string `json:"description,omitempty"` + // ActionsRequired - READ-ONLY; The actions required for private link service connection. + ActionsRequired *string `json:"actionsRequired,omitempty"` } -// AsLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeType. -func (lirt LinkedIntegrationRuntimeType) AsLinkedIntegrationRuntimeType() (*LinkedIntegrationRuntimeType, bool) { - return &lirt, true +// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionState. +func (plscs PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plscs.Status != nil { + objectMap["status"] = plscs.Status + } + if plscs.Description != nil { + objectMap["description"] = plscs.Description + } + return json.Marshal(objectMap) } -// AsBasicLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeType. -func (lirt LinkedIntegrationRuntimeType) AsBasicLinkedIntegrationRuntimeType() (BasicLinkedIntegrationRuntimeType, bool) { - return &lirt, true +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` } -// ListAvailableRpOperation ... -type ListAvailableRpOperation struct { - autorest.Response `json:"-"` - Value *[]AvailableRpOperation `json:"value,omitempty"` +// QueryInterval a database query. +type QueryInterval struct { + // IntervalStartTime - READ-ONLY; The start time of the measurement interval (ISO8601 format). + IntervalStartTime *date.Time `json:"intervalStartTime,omitempty"` + // ExecutionCount - READ-ONLY; The number of times the query was executed during this interval. + ExecutionCount *float64 `json:"executionCount,omitempty"` + // Metrics - READ-ONLY; The list of query metrics during this interval. + Metrics *[]QueryMetric `json:"metrics,omitempty"` } -// ManagedIdentity the workspace managed identity -type ManagedIdentity struct { - // PrincipalID - READ-ONLY; The principal ID of the workspace managed identity - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant ID of the workspace managed identity - TenantID *string `json:"tenantId,omitempty"` - // Type - The type of managed identity for the workspace. Possible values include: 'ResourceIdentityTypeNone', 'ResourceIdentityTypeSystemAssigned' - Type ResourceIdentityType `json:"type,omitempty"` +// QueryMetric a database query. +type QueryMetric struct { + // Name - READ-ONLY; The name of the metric + Name *string `json:"name,omitempty"` + // DisplayName - READ-ONLY; The name of the metric for display in user interface + DisplayName *string `json:"displayName,omitempty"` + // Unit - READ-ONLY; The unit of measurement. Possible values include: 'Percentage', 'KB', 'Microseconds' + Unit QueryMetricUnit `json:"unit,omitempty"` + // Value - READ-ONLY; The measured value + Value *float64 `json:"value,omitempty"` } -// MarshalJSON is the custom marshaler for ManagedIdentity. -func (mi ManagedIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mi.Type != "" { - objectMap["type"] = mi.Type - } - return json.Marshal(objectMap) +// QueryStatistic a database query. +type QueryStatistic struct { + // QueryID - READ-ONLY; The id of the query + QueryID *string `json:"queryId,omitempty"` + // Intervals - READ-ONLY; The list of query intervals. + Intervals *[]QueryInterval `json:"intervals,omitempty"` } -// ManagedIdentitySQLControlSettingsModel sql Control Settings for workspace managed identity -type ManagedIdentitySQLControlSettingsModel struct { +// RecoverableSQLPool a recoverable sql pool +type RecoverableSQLPool struct { autorest.Response `json:"-"` - // ManagedIdentitySQLControlSettingsModelProperties - Sql Control Settings for workspace managed identity - *ManagedIdentitySQLControlSettingsModelProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // RecoverableSQLPoolProperties - The properties of a recoverable sql pool + *RecoverableSQLPoolProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ManagedIdentitySQLControlSettingsModel. -func (miscsm ManagedIdentitySQLControlSettingsModel) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for RecoverableSQLPool. +func (rsp RecoverableSQLPool) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if miscsm.ManagedIdentitySQLControlSettingsModelProperties != nil { - objectMap["properties"] = miscsm.ManagedIdentitySQLControlSettingsModelProperties + if rsp.RecoverableSQLPoolProperties != nil { + objectMap["properties"] = rsp.RecoverableSQLPoolProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ManagedIdentitySQLControlSettingsModel struct. -func (miscsm *ManagedIdentitySQLControlSettingsModel) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for RecoverableSQLPool struct. +func (rsp *RecoverableSQLPool) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3332,12 +6847,12 @@ func (miscsm *ManagedIdentitySQLControlSettingsModel) UnmarshalJSON(body []byte) switch k { case "properties": if v != nil { - var managedIdentitySQLControlSettingsModelProperties ManagedIdentitySQLControlSettingsModelProperties - err = json.Unmarshal(*v, &managedIdentitySQLControlSettingsModelProperties) + var recoverableSQLPoolProperties RecoverableSQLPoolProperties + err = json.Unmarshal(*v, &recoverableSQLPoolProperties) if err != nil { return err } - miscsm.ManagedIdentitySQLControlSettingsModelProperties = &managedIdentitySQLControlSettingsModelProperties + rsp.RecoverableSQLPoolProperties = &recoverableSQLPoolProperties } case "id": if v != nil { @@ -3346,7 +6861,7 @@ func (miscsm *ManagedIdentitySQLControlSettingsModel) UnmarshalJSON(body []byte) if err != nil { return err } - miscsm.ID = &ID + rsp.ID = &ID } case "name": if v != nil { @@ -3355,7 +6870,7 @@ func (miscsm *ManagedIdentitySQLControlSettingsModel) UnmarshalJSON(body []byte) if err != nil { return err } - miscsm.Name = &name + rsp.Name = &name } case "type": if v != nil { @@ -3364,7 +6879,7 @@ func (miscsm *ManagedIdentitySQLControlSettingsModel) UnmarshalJSON(body []byte) if err != nil { return err } - miscsm.Type = &typeVar + rsp.Type = &typeVar } } } @@ -3372,86 +6887,225 @@ func (miscsm *ManagedIdentitySQLControlSettingsModel) UnmarshalJSON(body []byte) return nil } -// ManagedIdentitySQLControlSettingsModelProperties sql Control Settings for workspace managed identity -type ManagedIdentitySQLControlSettingsModelProperties struct { - // GrantSQLControlToManagedIdentity - Grant sql control to managed identity - GrantSQLControlToManagedIdentity *ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity `json:"grantSqlControlToManagedIdentity,omitempty"` +// RecoverableSQLPoolListResult the response to a list recoverable sql pools request +type RecoverableSQLPoolListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; A list of recoverable sql pool + Value *[]RecoverableSQLPool `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` } -// ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity grant sql control to -// managed identity -type ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity struct { - // DesiredState - Desired state. Possible values include: 'DesiredStateEnabled', 'DesiredStateDisabled' - DesiredState DesiredState `json:"desiredState,omitempty"` - // ActualState - READ-ONLY; Actual state. Possible values include: 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Unknown' - ActualState ActualState `json:"actualState,omitempty"` +// RecoverableSQLPoolListResultIterator provides access to a complete listing of RecoverableSQLPool values. +type RecoverableSQLPoolListResultIterator struct { + i int + page RecoverableSQLPoolListResultPage } -// MarshalJSON is the custom marshaler for ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity. -func (miscsmSctmi ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if miscsmSctmi.DesiredState != "" { - objectMap["desiredState"] = miscsmSctmi.DesiredState +// 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 *RecoverableSQLPoolListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableSQLPoolListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - return json.Marshal(objectMap) + 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 } -// ManagedIntegrationRuntime managed integration runtime, including managed elastic and managed dedicated -// integration runtimes. -type ManagedIntegrationRuntime struct { - // State - READ-ONLY; Integration runtime state, only valid for managed dedicated integration runtime. Possible values include: 'Initial', 'Stopped', 'Started', 'Starting', 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline', 'AccessDenied' - State IntegrationRuntimeState `json:"state,omitempty"` - // ManagedIntegrationRuntimeTypeProperties - Managed integration runtime properties. - *ManagedIntegrationRuntimeTypeProperties `json:"typeProperties,omitempty"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // Description - Integration runtime description. - Description *string `json:"description,omitempty"` - // Type - Possible values include: 'TypeIntegrationRuntime', 'TypeManaged', 'TypeSelfHosted' - Type Type `json:"type,omitempty"` +// 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 *RecoverableSQLPoolListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// MarshalJSON is the custom marshaler for ManagedIntegrationRuntime. -func (mir ManagedIntegrationRuntime) MarshalJSON() ([]byte, error) { - mir.Type = TypeManaged - objectMap := make(map[string]interface{}) - if mir.ManagedIntegrationRuntimeTypeProperties != nil { - objectMap["typeProperties"] = mir.ManagedIntegrationRuntimeTypeProperties +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoverableSQLPoolListResultIterator) 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 RecoverableSQLPoolListResultIterator) Response() RecoverableSQLPoolListResult { + 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 RecoverableSQLPoolListResultIterator) Value() RecoverableSQLPool { + if !iter.page.NotDone() { + return RecoverableSQLPool{} } - if mir.Description != nil { - objectMap["description"] = mir.Description + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoverableSQLPoolListResultIterator type. +func NewRecoverableSQLPoolListResultIterator(page RecoverableSQLPoolListResultPage) RecoverableSQLPoolListResultIterator { + return RecoverableSQLPoolListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rsplr RecoverableSQLPoolListResult) IsEmpty() bool { + return rsplr.Value == nil || len(*rsplr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rsplr RecoverableSQLPoolListResult) hasNextLink() bool { + return rsplr.NextLink != nil && len(*rsplr.NextLink) != 0 +} + +// recoverableSQLPoolListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rsplr RecoverableSQLPoolListResult) recoverableSQLPoolListResultPreparer(ctx context.Context) (*http.Request, error) { + if !rsplr.hasNextLink() { + return nil, nil } - if mir.Type != "" { - objectMap["type"] = mir.Type + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rsplr.NextLink))) +} + +// RecoverableSQLPoolListResultPage contains a page of RecoverableSQLPool values. +type RecoverableSQLPoolListResultPage struct { + fn func(context.Context, RecoverableSQLPoolListResult) (RecoverableSQLPoolListResult, error) + rsplr RecoverableSQLPoolListResult +} + +// 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 *RecoverableSQLPoolListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableSQLPoolListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - for k, v := range mir.AdditionalProperties { - objectMap[k] = v + for { + next, err := page.fn(ctx, page.rsplr) + if err != nil { + return err + } + page.rsplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - return json.Marshal(objectMap) + return nil } -// AsManagedIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime. -func (mir ManagedIntegrationRuntime) AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) { - return &mir, true +// 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 *RecoverableSQLPoolListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoverableSQLPoolListResultPage) NotDone() bool { + return !page.rsplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoverableSQLPoolListResultPage) Response() RecoverableSQLPoolListResult { + return page.rsplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoverableSQLPoolListResultPage) Values() []RecoverableSQLPool { + if page.rsplr.IsEmpty() { + return nil + } + return *page.rsplr.Value +} + +// Creates a new instance of the RecoverableSQLPoolListResultPage type. +func NewRecoverableSQLPoolListResultPage(cur RecoverableSQLPoolListResult, getNextPage func(context.Context, RecoverableSQLPoolListResult) (RecoverableSQLPoolListResult, error)) RecoverableSQLPoolListResultPage { + return RecoverableSQLPoolListResultPage{ + fn: getNextPage, + rsplr: cur, + } +} + +// RecoverableSQLPoolProperties the properties of a recoverable sql pool +type RecoverableSQLPoolProperties struct { + // Edition - READ-ONLY; The edition of the database + Edition *string `json:"edition,omitempty"` + // ServiceLevelObjective - READ-ONLY; The service level objective name of the database + ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"` + // ElasticPoolName - READ-ONLY; The elastic pool name of the database + ElasticPoolName *string `json:"elasticPoolName,omitempty"` + // LastAvailableBackupDate - READ-ONLY; The last available backup date of the database (ISO8601 format) + LastAvailableBackupDate *date.Time `json:"lastAvailableBackupDate,omitempty"` +} + +// ReplaceAllFirewallRulesOperationResponse an existing operation for replacing the firewall rules +type ReplaceAllFirewallRulesOperationResponse struct { + autorest.Response `json:"-"` + // OperationID - The operation ID + OperationID *string `json:"operationId,omitempty"` +} + +// ReplaceAllIPFirewallRulesRequest replace all IP firewall rules request +type ReplaceAllIPFirewallRulesRequest struct { + // IPFirewallRules - IP firewall rule properties + IPFirewallRules map[string]*IPFirewallRuleProperties `json:"ipFirewallRules"` } -// AsSelfHostedIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime. -func (mir ManagedIntegrationRuntime) AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) { - return nil, false +// MarshalJSON is the custom marshaler for ReplaceAllIPFirewallRulesRequest. +func (raifrr ReplaceAllIPFirewallRulesRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if raifrr.IPFirewallRules != nil { + objectMap["ipFirewallRules"] = raifrr.IPFirewallRules + } + return json.Marshal(objectMap) } -// AsIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime. -func (mir ManagedIntegrationRuntime) AsIntegrationRuntime() (*IntegrationRuntime, bool) { - return nil, false +// ReplicationLink represents a Sql pool replication link. +type ReplicationLink struct { + autorest.Response `json:"-"` + // Location - READ-ONLY; Location of the workspace that contains this firewall rule. + Location *string `json:"location,omitempty"` + // ReplicationLinkProperties - The properties representing the resource. + *ReplicationLinkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` } -// AsBasicIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime. -func (mir ManagedIntegrationRuntime) AsBasicIntegrationRuntime() (BasicIntegrationRuntime, bool) { - return &mir, true +// MarshalJSON is the custom marshaler for ReplicationLink. +func (rl ReplicationLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rl.ReplicationLinkProperties != nil { + objectMap["properties"] = rl.ReplicationLinkProperties + } + return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ManagedIntegrationRuntime struct. -func (mir *ManagedIntegrationRuntime) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ReplicationLink struct. +func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3459,53 +7113,50 @@ func (mir *ManagedIntegrationRuntime) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "state": + case "location": if v != nil { - var state IntegrationRuntimeState - err = json.Unmarshal(*v, &state) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - mir.State = state + rl.Location = &location } - case "typeProperties": + case "properties": if v != nil { - var managedIntegrationRuntimeTypeProperties ManagedIntegrationRuntimeTypeProperties - err = json.Unmarshal(*v, &managedIntegrationRuntimeTypeProperties) + var replicationLinkProperties ReplicationLinkProperties + err = json.Unmarshal(*v, &replicationLinkProperties) if err != nil { return err } - mir.ManagedIntegrationRuntimeTypeProperties = &managedIntegrationRuntimeTypeProperties + rl.ReplicationLinkProperties = &replicationLinkProperties } - default: + case "id": if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - if mir.AdditionalProperties == nil { - mir.AdditionalProperties = make(map[string]interface{}) - } - mir.AdditionalProperties[k] = additionalProperties + rl.ID = &ID } - case "description": + case "name": if v != nil { - var description string - err = json.Unmarshal(*v, &description) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - mir.Description = &description + rl.Name = &name } case "type": if v != nil { - var typeVar Type + var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - mir.Type = typeVar + rl.Type = &typeVar } } } @@ -3513,210 +7164,240 @@ func (mir *ManagedIntegrationRuntime) UnmarshalJSON(body []byte) error { return nil } -// ManagedIntegrationRuntimeError error definition for managed integration runtime. -type ManagedIntegrationRuntimeError struct { - // Time - READ-ONLY; The time when the error occurred. - Time *date.Time `json:"time,omitempty"` - // Code - READ-ONLY; Error code. - Code *string `json:"code,omitempty"` - // Parameters - READ-ONLY; Managed integration runtime error parameters. - Parameters *[]string `json:"parameters,omitempty"` - // Message - READ-ONLY; Error message. - Message *string `json:"message,omitempty"` -} - -// ManagedIntegrationRuntimeNode properties of integration runtime node. -type ManagedIntegrationRuntimeNode struct { - // NodeID - READ-ONLY; The managed integration runtime node id. - NodeID *string `json:"nodeId,omitempty"` - // Status - READ-ONLY; The managed integration runtime node status. Possible values include: 'ManagedIntegrationRuntimeNodeStatusStarting', 'ManagedIntegrationRuntimeNodeStatusAvailable', 'ManagedIntegrationRuntimeNodeStatusRecycling', 'ManagedIntegrationRuntimeNodeStatusUnavailable' - Status ManagedIntegrationRuntimeNodeStatus `json:"status,omitempty"` - // Errors - The errors that occurred on this integration runtime node. - Errors *[]ManagedIntegrationRuntimeError `json:"errors,omitempty"` +// ReplicationLinkListResult represents the response to a List Sql pool replication link request. +type ReplicationLinkListResult struct { + autorest.Response `json:"-"` + // Value - The list of Sql pool replication links housed in the Sql pool. + Value *[]ReplicationLink `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for ManagedIntegrationRuntimeNode. -func (mirn ManagedIntegrationRuntimeNode) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ReplicationLinkListResult. +func (rllr ReplicationLinkListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if mirn.Errors != nil { - objectMap["errors"] = mirn.Errors + if rllr.Value != nil { + objectMap["value"] = rllr.Value } return json.Marshal(objectMap) } -// ManagedIntegrationRuntimeOperationResult properties of managed integration runtime operation result. -type ManagedIntegrationRuntimeOperationResult struct { - // Type - READ-ONLY; The operation type. Could be start or stop. - Type *string `json:"type,omitempty"` - // StartTime - READ-ONLY; The start time of the operation. - StartTime *date.Time `json:"startTime,omitempty"` - // Result - READ-ONLY; The operation result. - Result *string `json:"result,omitempty"` - // ErrorCode - READ-ONLY; The error code. - ErrorCode *string `json:"errorCode,omitempty"` - // Parameters - READ-ONLY; Managed integration runtime error parameters. - Parameters *[]string `json:"parameters,omitempty"` - // ActivityID - READ-ONLY; The activity id for the operation request. - ActivityID *string `json:"activityId,omitempty"` +// ReplicationLinkListResultIterator provides access to a complete listing of ReplicationLink values. +type ReplicationLinkListResultIterator struct { + i int + page ReplicationLinkListResultPage } -// ManagedIntegrationRuntimeStatus managed integration runtime status. -type ManagedIntegrationRuntimeStatus struct { - // ManagedIntegrationRuntimeStatusTypeProperties - Managed integration runtime status type properties. - *ManagedIntegrationRuntimeStatusTypeProperties `json:"typeProperties,omitempty"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // DataFactoryName - READ-ONLY; The workspace name which the integration runtime belong to. - DataFactoryName *string `json:"dataFactoryName,omitempty"` - // State - READ-ONLY; The state of integration runtime. Possible values include: 'Initial', 'Stopped', 'Started', 'Starting', 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline', 'AccessDenied' - State IntegrationRuntimeState `json:"state,omitempty"` - // Type - Possible values include: 'TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus', 'TypeBasicIntegrationRuntimeStatusTypeManaged', 'TypeBasicIntegrationRuntimeStatusTypeSelfHosted' - Type TypeBasicIntegrationRuntimeStatus `json:"type,omitempty"` +// 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 *ReplicationLinkListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinkListResultIterator.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 } -// MarshalJSON is the custom marshaler for ManagedIntegrationRuntimeStatus. -func (mirs ManagedIntegrationRuntimeStatus) MarshalJSON() ([]byte, error) { - mirs.Type = TypeBasicIntegrationRuntimeStatusTypeManaged - objectMap := make(map[string]interface{}) - if mirs.ManagedIntegrationRuntimeStatusTypeProperties != nil { - objectMap["typeProperties"] = mirs.ManagedIntegrationRuntimeStatusTypeProperties +// 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 *ReplicationLinkListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationLinkListResultIterator) 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 ReplicationLinkListResultIterator) Response() ReplicationLinkListResult { + 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 ReplicationLinkListResultIterator) Value() ReplicationLink { + if !iter.page.NotDone() { + return ReplicationLink{} } - if mirs.Type != "" { - objectMap["type"] = mirs.Type + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationLinkListResultIterator type. +func NewReplicationLinkListResultIterator(page ReplicationLinkListResultPage) ReplicationLinkListResultIterator { + return ReplicationLinkListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rllr ReplicationLinkListResult) IsEmpty() bool { + return rllr.Value == nil || len(*rllr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rllr ReplicationLinkListResult) hasNextLink() bool { + return rllr.NextLink != nil && len(*rllr.NextLink) != 0 +} + +// replicationLinkListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rllr ReplicationLinkListResult) replicationLinkListResultPreparer(ctx context.Context) (*http.Request, error) { + if !rllr.hasNextLink() { + return nil, nil } - for k, v := range mirs.AdditionalProperties { - objectMap[k] = v + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rllr.NextLink))) +} + +// ReplicationLinkListResultPage contains a page of ReplicationLink values. +type ReplicationLinkListResultPage struct { + fn func(context.Context, ReplicationLinkListResult) (ReplicationLinkListResult, error) + rllr ReplicationLinkListResult +} + +// 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 *ReplicationLinkListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinkListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rllr) + if err != nil { + return err + } + page.rllr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - return json.Marshal(objectMap) + return nil } -// AsManagedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus. -func (mirs ManagedIntegrationRuntimeStatus) AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) { - return &mirs, true +// 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 *ReplicationLinkListResultPage) Next() error { + return page.NextWithContext(context.Background()) } -// AsSelfHostedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus. -func (mirs ManagedIntegrationRuntimeStatus) AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) { - return nil, false +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationLinkListResultPage) NotDone() bool { + return !page.rllr.IsEmpty() } -// AsIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus. -func (mirs ManagedIntegrationRuntimeStatus) AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (page ReplicationLinkListResultPage) Response() ReplicationLinkListResult { + return page.rllr } -// AsBasicIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus. -func (mirs ManagedIntegrationRuntimeStatus) AsBasicIntegrationRuntimeStatus() (BasicIntegrationRuntimeStatus, bool) { - return &mirs, true +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationLinkListResultPage) Values() []ReplicationLink { + if page.rllr.IsEmpty() { + return nil + } + return *page.rllr.Value } -// UnmarshalJSON is the custom unmarshaler for ManagedIntegrationRuntimeStatus struct. -func (mirs *ManagedIntegrationRuntimeStatus) 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 "typeProperties": - if v != nil { - var managedIntegrationRuntimeStatusTypeProperties ManagedIntegrationRuntimeStatusTypeProperties - err = json.Unmarshal(*v, &managedIntegrationRuntimeStatusTypeProperties) - if err != nil { - return err - } - mirs.ManagedIntegrationRuntimeStatusTypeProperties = &managedIntegrationRuntimeStatusTypeProperties - } - default: - if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) - if err != nil { - return err - } - if mirs.AdditionalProperties == nil { - mirs.AdditionalProperties = make(map[string]interface{}) - } - mirs.AdditionalProperties[k] = additionalProperties - } - case "dataFactoryName": - if v != nil { - var dataFactoryName string - err = json.Unmarshal(*v, &dataFactoryName) - if err != nil { - return err - } - mirs.DataFactoryName = &dataFactoryName - } - case "state": - if v != nil { - var state IntegrationRuntimeState - err = json.Unmarshal(*v, &state) - if err != nil { - return err - } - mirs.State = state - } - case "type": - if v != nil { - var typeVar TypeBasicIntegrationRuntimeStatus - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mirs.Type = typeVar - } - } +// Creates a new instance of the ReplicationLinkListResultPage type. +func NewReplicationLinkListResultPage(cur ReplicationLinkListResult, getNextPage func(context.Context, ReplicationLinkListResult) (ReplicationLinkListResult, error)) ReplicationLinkListResultPage { + return ReplicationLinkListResultPage{ + fn: getNextPage, + rllr: cur, } +} - return nil +// ReplicationLinkProperties represents the properties of a Sql pool replication link. +type ReplicationLinkProperties struct { + // IsTerminationAllowed - READ-ONLY; Legacy value indicating whether termination is allowed. Currently always returns true. + IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty"` + // ReplicationMode - READ-ONLY; Replication mode of this replication link. + ReplicationMode *string `json:"replicationMode,omitempty"` + // PartnerServer - READ-ONLY; The name of the workspace hosting the partner Sql pool. + PartnerServer *string `json:"partnerServer,omitempty"` + // PartnerDatabase - READ-ONLY; The name of the partner Sql pool. + PartnerDatabase *string `json:"partnerDatabase,omitempty"` + // PartnerLocation - READ-ONLY; The Azure Region of the partner Sql pool. + PartnerLocation *string `json:"partnerLocation,omitempty"` + // Role - READ-ONLY; The role of the Sql pool in the replication link. Possible values include: 'Primary', 'Secondary', 'NonReadableSecondary', 'Source', 'Copy' + Role ReplicationRole `json:"role,omitempty"` + // PartnerRole - READ-ONLY; The role of the partner Sql pool in the replication link. Possible values include: 'Primary', 'Secondary', 'NonReadableSecondary', 'Source', 'Copy' + PartnerRole ReplicationRole `json:"partnerRole,omitempty"` + // StartTime - READ-ONLY; The start time for the replication link. + StartTime *date.Time `json:"startTime,omitempty"` + // PercentComplete - READ-ONLY; The percentage of seeding complete for the replication link. + PercentComplete *int32 `json:"percentComplete,omitempty"` + // ReplicationState - READ-ONLY; The replication state for the replication link. Possible values include: 'PENDING', 'SEEDING', 'CATCHUP', 'SUSPENDED' + ReplicationState ReplicationState `json:"replicationState,omitempty"` } -// ManagedIntegrationRuntimeStatusTypeProperties managed integration runtime status type properties. -type ManagedIntegrationRuntimeStatusTypeProperties struct { - // CreateTime - READ-ONLY; The time at which the integration runtime was created, in ISO8601 format. - CreateTime *date.Time `json:"createTime,omitempty"` - // Nodes - READ-ONLY; The list of nodes for managed integration runtime. - Nodes *[]ManagedIntegrationRuntimeNode `json:"nodes,omitempty"` - // OtherErrors - READ-ONLY; The errors that occurred on this integration runtime. - OtherErrors *[]ManagedIntegrationRuntimeError `json:"otherErrors,omitempty"` - // LastOperation - READ-ONLY; The last operation result that occurred on this integration runtime. - LastOperation *ManagedIntegrationRuntimeOperationResult `json:"lastOperation,omitempty"` +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` } -// ManagedIntegrationRuntimeTypeProperties managed integration runtime type properties. -type ManagedIntegrationRuntimeTypeProperties struct { - // ComputeProperties - The compute resource for managed integration runtime. - ComputeProperties *IntegrationRuntimeComputeProperties `json:"computeProperties,omitempty"` - // SsisProperties - SSIS properties for managed integration runtime. - SsisProperties *IntegrationRuntimeSsisProperties `json:"ssisProperties,omitempty"` +// ResourceMoveDefinition contains the information necessary to perform a resource move (rename). +type ResourceMoveDefinition struct { + // ID - The target ID for the resource + ID *string `json:"id,omitempty"` } -// MetadataSyncConfig configuration for metadata sync -type MetadataSyncConfig struct { +// RestorableDroppedSQLPool a restorable dropped Sql pool +type RestorableDroppedSQLPool struct { autorest.Response `json:"-"` - // MetadataSyncConfigProperties - Metadata Sync Config properties - *MetadataSyncConfigProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // Location - READ-ONLY; The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // RestorableDroppedSQLPoolProperties - The properties of a restorable dropped Sql pool + *RestorableDroppedSQLPoolProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for MetadataSyncConfig. -func (msc MetadataSyncConfig) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for RestorableDroppedSQLPool. +func (rdsp RestorableDroppedSQLPool) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if msc.MetadataSyncConfigProperties != nil { - objectMap["properties"] = msc.MetadataSyncConfigProperties + if rdsp.RestorableDroppedSQLPoolProperties != nil { + objectMap["properties"] = rdsp.RestorableDroppedSQLPoolProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for MetadataSyncConfig struct. -func (msc *MetadataSyncConfig) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for RestorableDroppedSQLPool struct. +func (rdsp *RestorableDroppedSQLPool) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3724,14 +7405,23 @@ func (msc *MetadataSyncConfig) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rdsp.Location = &location + } case "properties": if v != nil { - var metadataSyncConfigProperties MetadataSyncConfigProperties - err = json.Unmarshal(*v, &metadataSyncConfigProperties) + var restorableDroppedSQLPoolProperties RestorableDroppedSQLPoolProperties + err = json.Unmarshal(*v, &restorableDroppedSQLPoolProperties) if err != nil { return err } - msc.MetadataSyncConfigProperties = &metadataSyncConfigProperties + rdsp.RestorableDroppedSQLPoolProperties = &restorableDroppedSQLPoolProperties } case "id": if v != nil { @@ -3740,7 +7430,7 @@ func (msc *MetadataSyncConfig) UnmarshalJSON(body []byte) error { if err != nil { return err } - msc.ID = &ID + rdsp.ID = &ID } case "name": if v != nil { @@ -3749,7 +7439,7 @@ func (msc *MetadataSyncConfig) UnmarshalJSON(body []byte) error { if err != nil { return err } - msc.Name = &name + rdsp.Name = &name } case "type": if v != nil { @@ -3758,131 +7448,67 @@ func (msc *MetadataSyncConfig) UnmarshalJSON(body []byte) error { if err != nil { return err } - msc.Type = &typeVar + rdsp.Type = &typeVar } } - } - - return nil -} - -// MetadataSyncConfigProperties metadata Sync Config properties -type MetadataSyncConfigProperties struct { - // Enabled - Indicates whether the metadata sync is enabled or disabled - Enabled *bool `json:"enabled,omitempty"` -} - -// OperationMetaLogSpecification what is this? -type OperationMetaLogSpecification struct { - // DisplayName - Log display name - DisplayName *string `json:"displayName,omitempty"` - // BlobDuration - Time range the log covers - BlobDuration *string `json:"blobDuration,omitempty"` - // Name - Log unique name - Name *string `json:"name,omitempty"` -} - -// OperationMetaMetricDimensionSpecification what is this? -type OperationMetaMetricDimensionSpecification struct { - // DisplayName - Dimension display name - DisplayName *string `json:"displayName,omitempty"` - // Name - Dimension unique name - Name *string `json:"name,omitempty"` - // ToBeExportedForShoebox - Whether this metric should be exported for Shoebox - ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` -} - -// OperationMetaMetricSpecification what is this? -type OperationMetaMetricSpecification struct { - // SourceMdmNamespace - The source MDM namespace - SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"` - // DisplayName - Metric display name - DisplayName *string `json:"displayName,omitempty"` - // Name - Metric unique name - Name *string `json:"name,omitempty"` - // AggregationType - Metric aggregation type - AggregationType *string `json:"aggregationType,omitempty"` - // DisplayDescription - Metric description - DisplayDescription *string `json:"displayDescription,omitempty"` - // SourceMdmAccount - The source MDM account - SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"` - // EnableRegionalMdmAccount - Whether the regional MDM account is enabled - EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"` - // Unit - Metric units - Unit *string `json:"unit,omitempty"` - // Dimensions - Metric dimensions - Dimensions *[]OperationMetaMetricDimensionSpecification `json:"dimensions,omitempty"` - // SupportsInstanceLevelAggregation - Whether the metric supports instance-level aggregation - SupportsInstanceLevelAggregation *bool `json:"supportsInstanceLevelAggregation,omitempty"` - // MetricFilterPattern - Metric filter - MetricFilterPattern *string `json:"metricFilterPattern,omitempty"` -} - -// OperationMetaPropertyInfo what is this? -type OperationMetaPropertyInfo struct { - // ServiceSpecification - Operation service specification - ServiceSpecification *OperationMetaServiceSpecification `json:"serviceSpecification,omitempty"` -} - -// OperationMetaServiceSpecification what is this? -type OperationMetaServiceSpecification struct { - // MetricSpecifications - Service metric specifications - MetricSpecifications *[]OperationMetaMetricSpecification `json:"metricSpecifications,omitempty"` - // LogSpecifications - Service log specifications - LogSpecifications *[]OperationMetaLogSpecification `json:"logSpecifications,omitempty"` -} - -// OperationResource an operation -type OperationResource struct { - autorest.Response `json:"-"` - // ID - Operation ID - ID *string `json:"id,omitempty"` - // Name - Operation name - Name *string `json:"name,omitempty"` - // Status - Operation status. Possible values include: 'OperationStatusInProgress', 'OperationStatusSucceeded', 'OperationStatusFailed', 'OperationStatusCanceled' - Status OperationStatus `json:"status,omitempty"` - // Properties - Operation properties - Properties interface{} `json:"properties,omitempty"` - // Error - Errors from the operation - Error *ErrorDetail `json:"error,omitempty"` - // StartTime - Operation start time - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Operation start time - EndTime *date.Time `json:"endTime,omitempty"` - // PercentComplete - Completion percentage of the operation - PercentComplete *float64 `json:"percentComplete,omitempty"` + } + + return nil } -// PrivateEndpoint private endpoint details -type PrivateEndpoint struct { - // ID - READ-ONLY; Resource id of the private endpoint. - ID *string `json:"id,omitempty"` +// RestorableDroppedSQLPoolListResult the response to a list restorable dropped Sql pools request +type RestorableDroppedSQLPoolListResult struct { + autorest.Response `json:"-"` + // Value - A list of restorable dropped Sql pools + Value *[]RestorableDroppedSQLPool `json:"value,omitempty"` } -// PrivateEndpointConnection a private endpoint connection -type PrivateEndpointConnection struct { +// RestorableDroppedSQLPoolProperties the properties of a restorable dropped Sql pool +type RestorableDroppedSQLPoolProperties struct { + // DatabaseName - READ-ONLY; The name of the database + DatabaseName *string `json:"databaseName,omitempty"` + // Edition - READ-ONLY; The edition of the database + Edition *string `json:"edition,omitempty"` + // MaxSizeBytes - READ-ONLY; The max size in bytes of the database + MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` + // ServiceLevelObjective - READ-ONLY; The service level objective name of the database + ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"` + // ElasticPoolName - READ-ONLY; The elastic pool name of the database + ElasticPoolName *string `json:"elasticPoolName,omitempty"` + // CreationDate - READ-ONLY; The creation date of the database (ISO8601 format) + CreationDate *date.Time `json:"creationDate,omitempty"` + // DeletionDate - READ-ONLY; The deletion date of the database (ISO8601 format) + DeletionDate *date.Time `json:"deletionDate,omitempty"` + // EarliestRestoreDate - READ-ONLY; The earliest restore date of the database (ISO8601 format) + EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` +} + +// RestorePoint database restore points. +type RestorePoint struct { autorest.Response `json:"-"` - // PrivateEndpointConnectionProperties - Private endpoint connection properties. - *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // Location - READ-ONLY; Resource location. + Location *string `json:"location,omitempty"` + // RestorePointProperties - Resource properties. + *RestorePointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for PrivateEndpointConnection. -func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for RestorePoint. +func (rp RestorePoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pec.PrivateEndpointConnectionProperties != nil { - objectMap["properties"] = pec.PrivateEndpointConnectionProperties + if rp.RestorePointProperties != nil { + objectMap["properties"] = rp.RestorePointProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. -func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for RestorePoint struct. +func (rp *RestorePoint) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3890,14 +7516,23 @@ func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rp.Location = &location + } case "properties": if v != nil { - var privateEndpointConnectionProperties PrivateEndpointConnectionProperties - err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + var restorePointProperties RestorePointProperties + err = json.Unmarshal(*v, &restorePointProperties) if err != nil { return err } - pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + rp.RestorePointProperties = &restorePointProperties } case "id": if v != nil { @@ -3906,7 +7541,7 @@ func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { if err != nil { return err } - pec.ID = &ID + rp.ID = &ID } case "name": if v != nil { @@ -3915,7 +7550,7 @@ func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { if err != nil { return err } - pec.Name = &name + rp.Name = &name } case "type": if v != nil { @@ -3924,7 +7559,7 @@ func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { if err != nil { return err } - pec.Type = &typeVar + rp.Type = &typeVar } } } @@ -3932,27 +7567,26 @@ func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { return nil } -// PrivateEndpointConnectionList a list of private endpoint connections -type PrivateEndpointConnectionList struct { +// RestorePointListResult a list of long term retention backups. +type RestorePointListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; Array of results. - Value *[]PrivateEndpointConnection `json:"value,omitempty"` + Value *[]RestorePoint `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } -// PrivateEndpointConnectionListIterator provides access to a complete listing of PrivateEndpointConnection -// values. -type PrivateEndpointConnectionListIterator struct { +// RestorePointListResultIterator provides access to a complete listing of RestorePoint values. +type RestorePointListResultIterator struct { i int - page PrivateEndpointConnectionListPage + page RestorePointListResultPage } // 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 *PrivateEndpointConnectionListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *RestorePointListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -3977,67 +7611,67 @@ func (iter *PrivateEndpointConnectionListIterator) NextWithContext(ctx context.C // 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 *PrivateEndpointConnectionListIterator) Next() error { +func (iter *RestorePointListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateEndpointConnectionListIterator) NotDone() bool { +func (iter RestorePointListResultIterator) 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 PrivateEndpointConnectionListIterator) Response() PrivateEndpointConnectionList { +func (iter RestorePointListResultIterator) Response() RestorePointListResult { 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 PrivateEndpointConnectionListIterator) Value() PrivateEndpointConnection { +func (iter RestorePointListResultIterator) Value() RestorePoint { if !iter.page.NotDone() { - return PrivateEndpointConnection{} + return RestorePoint{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the PrivateEndpointConnectionListIterator type. -func NewPrivateEndpointConnectionListIterator(page PrivateEndpointConnectionListPage) PrivateEndpointConnectionListIterator { - return PrivateEndpointConnectionListIterator{page: page} +// Creates a new instance of the RestorePointListResultIterator type. +func NewRestorePointListResultIterator(page RestorePointListResultPage) RestorePointListResultIterator { + return RestorePointListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (pecl PrivateEndpointConnectionList) IsEmpty() bool { - return pecl.Value == nil || len(*pecl.Value) == 0 +func (rplr RestorePointListResult) IsEmpty() bool { + return rplr.Value == nil || len(*rplr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (pecl PrivateEndpointConnectionList) hasNextLink() bool { - return pecl.NextLink != nil && len(*pecl.NextLink) != 0 +func (rplr RestorePointListResult) hasNextLink() bool { + return rplr.NextLink != nil && len(*rplr.NextLink) != 0 } -// privateEndpointConnectionListPreparer prepares a request to retrieve the next set of results. +// restorePointListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (pecl PrivateEndpointConnectionList) privateEndpointConnectionListPreparer(ctx context.Context) (*http.Request, error) { - if !pecl.hasNextLink() { +func (rplr RestorePointListResult) restorePointListResultPreparer(ctx context.Context) (*http.Request, error) { + if !rplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(pecl.NextLink))) + autorest.WithBaseURL(to.String(rplr.NextLink))) } -// PrivateEndpointConnectionListPage contains a page of PrivateEndpointConnection values. -type PrivateEndpointConnectionListPage struct { - fn func(context.Context, PrivateEndpointConnectionList) (PrivateEndpointConnectionList, error) - pecl PrivateEndpointConnectionList +// RestorePointListResultPage contains a page of RestorePoint values. +type RestorePointListResultPage struct { + fn func(context.Context, RestorePointListResult) (RestorePointListResult, error) + rplr RestorePointListResult } // 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 *PrivateEndpointConnectionListPage) NextWithContext(ctx context.Context) (err error) { +func (page *RestorePointListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -4047,11 +7681,11 @@ func (page *PrivateEndpointConnectionListPage) NextWithContext(ctx context.Conte }() } for { - next, err := page.fn(ctx, page.pecl) + next, err := page.fn(ctx, page.rplr) if err != nil { return err } - page.pecl = next + page.rplr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -4062,147 +7696,410 @@ func (page *PrivateEndpointConnectionListPage) NextWithContext(ctx context.Conte // 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 *PrivateEndpointConnectionListPage) Next() error { +func (page *RestorePointListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateEndpointConnectionListPage) NotDone() bool { - return !page.pecl.IsEmpty() +func (page RestorePointListResultPage) NotDone() bool { + return !page.rplr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page PrivateEndpointConnectionListPage) Response() PrivateEndpointConnectionList { - return page.pecl +func (page RestorePointListResultPage) Response() RestorePointListResult { + return page.rplr } // Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateEndpointConnectionListPage) Values() []PrivateEndpointConnection { - if page.pecl.IsEmpty() { +func (page RestorePointListResultPage) Values() []RestorePoint { + if page.rplr.IsEmpty() { return nil } - return *page.pecl.Value + return *page.rplr.Value +} + +// Creates a new instance of the RestorePointListResultPage type. +func NewRestorePointListResultPage(cur RestorePointListResult, getNextPage func(context.Context, RestorePointListResult) (RestorePointListResult, error)) RestorePointListResultPage { + return RestorePointListResultPage{ + fn: getNextPage, + rplr: cur, + } +} + +// RestorePointProperties properties of a database restore point +type RestorePointProperties struct { + // RestorePointType - READ-ONLY; The type of restore point. Possible values include: 'CONTINUOUS', 'DISCRETE' + RestorePointType RestorePointType `json:"restorePointType,omitempty"` + // EarliestRestoreDate - READ-ONLY; The earliest time to which this database can be restored + EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` + // RestorePointCreationDate - READ-ONLY; The time the backup was taken + RestorePointCreationDate *date.Time `json:"restorePointCreationDate,omitempty"` + // RestorePointLabel - READ-ONLY; The label of restore point for backup request by user + RestorePointLabel *string `json:"restorePointLabel,omitempty"` +} + +// BasicSecretBase the base definition of a secret type. +type BasicSecretBase interface { + AsSecureString() (*SecureString, bool) + AsSecretBase() (*SecretBase, bool) +} + +// SecretBase the base definition of a secret type. +type SecretBase struct { + // Type - Possible values include: 'TypeSecretBase', 'TypeSecureString' + Type TypeBasicSecretBase `json:"type,omitempty"` +} + +func unmarshalBasicSecretBase(body []byte) (BasicSecretBase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeSecureString): + var ss SecureString + err := json.Unmarshal(body, &ss) + return ss, err + default: + var sb SecretBase + err := json.Unmarshal(body, &sb) + return sb, err + } +} +func unmarshalBasicSecretBaseArray(body []byte) ([]BasicSecretBase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sbArray := make([]BasicSecretBase, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sb, err := unmarshalBasicSecretBase(*rawMessage) + if err != nil { + return nil, err + } + sbArray[index] = sb + } + return sbArray, nil +} + +// MarshalJSON is the custom marshaler for SecretBase. +func (sb SecretBase) MarshalJSON() ([]byte, error) { + sb.Type = TypeSecretBase + objectMap := make(map[string]interface{}) + if sb.Type != "" { + objectMap["type"] = sb.Type + } + return json.Marshal(objectMap) +} + +// AsSecureString is the BasicSecretBase implementation for SecretBase. +func (sb SecretBase) AsSecureString() (*SecureString, bool) { + return nil, false +} + +// AsSecretBase is the BasicSecretBase implementation for SecretBase. +func (sb SecretBase) AsSecretBase() (*SecretBase, bool) { + return &sb, true +} + +// AsBasicSecretBase is the BasicSecretBase implementation for SecretBase. +func (sb SecretBase) AsBasicSecretBase() (BasicSecretBase, bool) { + return &sb, true +} + +// SecureString azure Synapse secure string definition. The string value will be masked with asterisks '*' +// during Get or List API calls. +type SecureString struct { + // Value - Value of secure string. + Value *string `json:"value,omitempty"` + // Type - Possible values include: 'TypeSecretBase', 'TypeSecureString' + Type TypeBasicSecretBase `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureString. +func (ss SecureString) MarshalJSON() ([]byte, error) { + ss.Type = TypeSecureString + objectMap := make(map[string]interface{}) + if ss.Value != nil { + objectMap["value"] = ss.Value + } + if ss.Type != "" { + objectMap["type"] = ss.Type + } + return json.Marshal(objectMap) +} + +// AsSecureString is the BasicSecretBase implementation for SecureString. +func (ss SecureString) AsSecureString() (*SecureString, bool) { + return &ss, true +} + +// AsSecretBase is the BasicSecretBase implementation for SecureString. +func (ss SecureString) AsSecretBase() (*SecretBase, bool) { + return nil, false } -// Creates a new instance of the PrivateEndpointConnectionListPage type. -func NewPrivateEndpointConnectionListPage(getNextPage func(context.Context, PrivateEndpointConnectionList) (PrivateEndpointConnectionList, error)) PrivateEndpointConnectionListPage { - return PrivateEndpointConnectionListPage{fn: getNextPage} +// AsBasicSecretBase is the BasicSecretBase implementation for SecureString. +func (ss SecureString) AsBasicSecretBase() (BasicSecretBase, bool) { + return &ss, true } -// PrivateEndpointConnectionProperties properties of a private endpoint connection. -type PrivateEndpointConnectionProperties struct { - // PrivateEndpoint - The private endpoint which the connection belongs to. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - // PrivateLinkServiceConnectionState - Connection state of the private endpoint connection. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - // ProvisioningState - READ-ONLY; Provisioning state of the private endpoint connection. - ProvisioningState *string `json:"provisioningState,omitempty"` +// SecurityAlertPolicyProperties properties of a security alert policy. +type SecurityAlertPolicyProperties struct { + // State - Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific Sql pool. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled' + State SecurityAlertPolicyState `json:"state,omitempty"` + // DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action + DisabledAlerts *[]string `json:"disabledAlerts,omitempty"` + // EmailAddresses - Specifies an array of e-mail addresses to which the alert is sent. + EmailAddresses *[]string `json:"emailAddresses,omitempty"` + // EmailAccountAdmins - Specifies that the alert is sent to the account administrators. + EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"` + // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. + StorageEndpoint *string `json:"storageEndpoint,omitempty"` + // StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. + StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + // RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs. + RetentionDays *int32 `json:"retentionDays,omitempty"` + // CreationTime - READ-ONLY; Specifies the UTC creation time of the policy. + CreationTime *date.Time `json:"creationTime,omitempty"` } -// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. -func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SecurityAlertPolicyProperties. +func (sapp SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pecp.PrivateEndpoint != nil { - objectMap["privateEndpoint"] = pecp.PrivateEndpoint + if sapp.State != "" { + objectMap["state"] = sapp.State } - if pecp.PrivateLinkServiceConnectionState != nil { - objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState + if sapp.DisabledAlerts != nil { + objectMap["disabledAlerts"] = sapp.DisabledAlerts + } + if sapp.EmailAddresses != nil { + objectMap["emailAddresses"] = sapp.EmailAddresses + } + if sapp.EmailAccountAdmins != nil { + objectMap["emailAccountAdmins"] = sapp.EmailAccountAdmins + } + if sapp.StorageEndpoint != nil { + objectMap["storageEndpoint"] = sapp.StorageEndpoint + } + if sapp.StorageAccountAccessKey != nil { + objectMap["storageAccountAccessKey"] = sapp.StorageAccountAccessKey + } + if sapp.RetentionDays != nil { + objectMap["retentionDays"] = sapp.RetentionDays } return json.Marshal(objectMap) } -// PrivateEndpointConnectionsCreateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateEndpointConnectionsCreateFuture struct { - azure.Future +// SelfHostedIntegrationRuntime self-hosted integration runtime. +type SelfHostedIntegrationRuntime struct { + // SelfHostedIntegrationRuntimeTypeProperties - When this property is not null, means this is a linked integration runtime. The property is used to access original integration runtime. + *SelfHostedIntegrationRuntimeTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Integration runtime description. + Description *string `json:"description,omitempty"` + // Type - Possible values include: 'TypeIntegrationRuntime', 'TypeManaged', 'TypeSelfHosted' + Type Type `json:"type,omitempty"` } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PrivateEndpointConnectionsCreateFuture) Result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsCreateFuture", "Result", future.Response(), "Polling failure") - return +// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntime. +func (shir SelfHostedIntegrationRuntime) MarshalJSON() ([]byte, error) { + shir.Type = TypeSelfHosted + objectMap := make(map[string]interface{}) + if shir.SelfHostedIntegrationRuntimeTypeProperties != nil { + objectMap["typeProperties"] = shir.SelfHostedIntegrationRuntimeTypeProperties } - if !done { - err = azure.NewAsyncOpIncompleteError("synapse.PrivateEndpointConnectionsCreateFuture") - return + if shir.Description != nil { + objectMap["description"] = shir.Description } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { - pec, err = client.CreateResponder(pec.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsCreateFuture", "Result", pec.Response.Response, "Failure responding to request") - } + if shir.Type != "" { + objectMap["type"] = shir.Type } - return + for k, v := range shir.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) } -// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateEndpointConnectionsDeleteFuture struct { - azure.Future +// AsManagedIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime. +func (shir SelfHostedIntegrationRuntime) AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) { + return nil, false } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PrivateEndpointConnectionsDeleteFuture) Result(client PrivateEndpointConnectionsClient) (or OperationResource, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) +// AsSelfHostedIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime. +func (shir SelfHostedIntegrationRuntime) AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) { + return &shir, true +} + +// AsIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime. +func (shir SelfHostedIntegrationRuntime) AsIntegrationRuntime() (*IntegrationRuntime, bool) { + return nil, false +} + +// AsBasicIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime. +func (shir SelfHostedIntegrationRuntime) AsBasicIntegrationRuntime() (BasicIntegrationRuntime, bool) { + return &shir, true +} + +// UnmarshalJSON is the custom unmarshaler for SelfHostedIntegrationRuntime struct. +func (shir *SelfHostedIntegrationRuntime) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) if err != nil { - err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("synapse.PrivateEndpointConnectionsDeleteFuture") - return + return err } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if or.Response.Response, err = future.GetResult(sender); err == nil && or.Response.Response.StatusCode != http.StatusNoContent { - or, err = client.DeleteResponder(or.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsDeleteFuture", "Result", or.Response.Response, "Failure responding to request") + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var selfHostedIntegrationRuntimeTypeProperties SelfHostedIntegrationRuntimeTypeProperties + err = json.Unmarshal(*v, &selfHostedIntegrationRuntimeTypeProperties) + if err != nil { + return err + } + shir.SelfHostedIntegrationRuntimeTypeProperties = &selfHostedIntegrationRuntimeTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if shir.AdditionalProperties == nil { + shir.AdditionalProperties = make(map[string]interface{}) + } + shir.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + shir.Description = &description + } + case "type": + if v != nil { + var typeVar Type + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + shir.Type = typeVar + } } } - return + + return nil } -// PrivateLinkHub a privateLinkHub -type PrivateLinkHub struct { +// SelfHostedIntegrationRuntimeNode properties of Self-hosted integration runtime node. +type SelfHostedIntegrationRuntimeNode struct { autorest.Response `json:"-"` - // PrivateLinkHubProperties - PrivateLinkHub resource properties - *PrivateLinkHubProperties `json:"properties,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` + // NodeName - READ-ONLY; Name of the integration runtime node. + NodeName *string `json:"nodeName,omitempty"` + // MachineName - READ-ONLY; Machine name of the integration runtime node. + MachineName *string `json:"machineName,omitempty"` + // HostServiceURI - READ-ONLY; URI for the host machine of the integration runtime. + HostServiceURI *string `json:"hostServiceUri,omitempty"` + // Status - READ-ONLY; Status of the integration runtime node. Possible values include: 'SelfHostedIntegrationRuntimeNodeStatusNeedRegistration', 'SelfHostedIntegrationRuntimeNodeStatusOnline', 'SelfHostedIntegrationRuntimeNodeStatusLimited', 'SelfHostedIntegrationRuntimeNodeStatusOffline', 'SelfHostedIntegrationRuntimeNodeStatusUpgrading', 'SelfHostedIntegrationRuntimeNodeStatusInitializing', 'SelfHostedIntegrationRuntimeNodeStatusInitializeFailed' + Status SelfHostedIntegrationRuntimeNodeStatus `json:"status,omitempty"` + // Capabilities - READ-ONLY; The integration runtime capabilities dictionary + Capabilities map[string]*string `json:"capabilities"` + // VersionStatus - READ-ONLY; Status of the integration runtime node version. + VersionStatus *string `json:"versionStatus,omitempty"` + // Version - READ-ONLY; Version of the integration runtime node. + Version *string `json:"version,omitempty"` + // RegisterTime - READ-ONLY; The time at which the integration runtime node was registered in ISO8601 format. + RegisterTime *date.Time `json:"registerTime,omitempty"` + // LastConnectTime - READ-ONLY; The most recent time at which the integration runtime was connected in ISO8601 format. + LastConnectTime *date.Time `json:"lastConnectTime,omitempty"` + // ExpiryTime - READ-ONLY; The time at which the integration runtime will expire in ISO8601 format. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // LastStartTime - READ-ONLY; The time the node last started up. + LastStartTime *date.Time `json:"lastStartTime,omitempty"` + // LastStopTime - READ-ONLY; The integration runtime node last stop time. + LastStopTime *date.Time `json:"lastStopTime,omitempty"` + // LastUpdateResult - READ-ONLY; The result of the last integration runtime node update. Possible values include: 'None', 'Succeed', 'Fail' + LastUpdateResult IntegrationRuntimeUpdateResult `json:"lastUpdateResult,omitempty"` + // LastStartUpdateTime - READ-ONLY; The last time for the integration runtime node update start. + LastStartUpdateTime *date.Time `json:"lastStartUpdateTime,omitempty"` + // LastEndUpdateTime - READ-ONLY; The last time for the integration runtime node update end. + LastEndUpdateTime *date.Time `json:"lastEndUpdateTime,omitempty"` + // IsActiveDispatcher - READ-ONLY; Indicates whether this node is the active dispatcher for integration runtime requests. + IsActiveDispatcher *bool `json:"isActiveDispatcher,omitempty"` + // ConcurrentJobsLimit - READ-ONLY; Maximum concurrent jobs on the integration runtime node. + ConcurrentJobsLimit *int32 `json:"concurrentJobsLimit,omitempty"` + // MaxConcurrentJobs - READ-ONLY; The maximum concurrent jobs in this integration runtime. + MaxConcurrentJobs *int32 `json:"maxConcurrentJobs,omitempty"` +} + +// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntimeNode. +func (shirn SelfHostedIntegrationRuntimeNode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SelfHostedIntegrationRuntimeStatus self-hosted integration runtime status. +type SelfHostedIntegrationRuntimeStatus struct { + // SelfHostedIntegrationRuntimeStatusTypeProperties - Self-hosted integration runtime status type properties. + *SelfHostedIntegrationRuntimeStatusTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // DataFactoryName - READ-ONLY; The workspace name which the integration runtime belong to. + DataFactoryName *string `json:"dataFactoryName,omitempty"` + // State - READ-ONLY; The state of integration runtime. Possible values include: 'Initial', 'Stopped', 'Started', 'Starting', 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline', 'AccessDenied' + State IntegrationRuntimeState `json:"state,omitempty"` + // Type - Possible values include: 'TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus', 'TypeBasicIntegrationRuntimeStatusTypeManaged', 'TypeBasicIntegrationRuntimeStatusTypeSelfHosted' + Type TypeBasicIntegrationRuntimeStatus `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for PrivateLinkHub. -func (plh PrivateLinkHub) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntimeStatus. +func (shirs SelfHostedIntegrationRuntimeStatus) MarshalJSON() ([]byte, error) { + shirs.Type = TypeBasicIntegrationRuntimeStatusTypeSelfHosted objectMap := make(map[string]interface{}) - if plh.PrivateLinkHubProperties != nil { - objectMap["properties"] = plh.PrivateLinkHubProperties + if shirs.SelfHostedIntegrationRuntimeStatusTypeProperties != nil { + objectMap["typeProperties"] = shirs.SelfHostedIntegrationRuntimeStatusTypeProperties } - if plh.Tags != nil { - objectMap["tags"] = plh.Tags + if shirs.Type != "" { + objectMap["type"] = shirs.Type } - if plh.Location != nil { - objectMap["location"] = plh.Location + for k, v := range shirs.AdditionalProperties { + objectMap[k] = v } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for PrivateLinkHub struct. -func (plh *PrivateLinkHub) UnmarshalJSON(body []byte) error { +// AsManagedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus. +func (shirs SelfHostedIntegrationRuntimeStatus) AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) { + return nil, false +} + +// AsSelfHostedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus. +func (shirs SelfHostedIntegrationRuntimeStatus) AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) { + return &shirs, true +} + +// AsIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus. +func (shirs SelfHostedIntegrationRuntimeStatus) AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) { + return nil, false +} + +// AsBasicIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus. +func (shirs SelfHostedIntegrationRuntimeStatus) AsBasicIntegrationRuntimeStatus() (BasicIntegrationRuntimeStatus, bool) { + return &shirs, true +} + +// UnmarshalJSON is the custom unmarshaler for SelfHostedIntegrationRuntimeStatus struct. +func (shirs *SelfHostedIntegrationRuntimeStatus) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4210,59 +8107,53 @@ func (plh *PrivateLinkHub) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": + case "typeProperties": if v != nil { - var privateLinkHubProperties PrivateLinkHubProperties - err = json.Unmarshal(*v, &privateLinkHubProperties) + var selfHostedIntegrationRuntimeStatusTypeProperties SelfHostedIntegrationRuntimeStatusTypeProperties + err = json.Unmarshal(*v, &selfHostedIntegrationRuntimeStatusTypeProperties) if err != nil { return err } - plh.PrivateLinkHubProperties = &privateLinkHubProperties + shirs.SelfHostedIntegrationRuntimeStatusTypeProperties = &selfHostedIntegrationRuntimeStatusTypeProperties } - case "tags": + default: if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) if err != nil { return err } - plh.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err + if shirs.AdditionalProperties == nil { + shirs.AdditionalProperties = make(map[string]interface{}) } - plh.Location = &location + shirs.AdditionalProperties[k] = additionalProperties } - case "id": + case "dataFactoryName": if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var dataFactoryName string + err = json.Unmarshal(*v, &dataFactoryName) if err != nil { return err } - plh.ID = &ID + shirs.DataFactoryName = &dataFactoryName } - case "name": + case "state": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var state IntegrationRuntimeState + err = json.Unmarshal(*v, &state) if err != nil { return err } - plh.Name = &name + shirs.State = state } case "type": if v != nil { - var typeVar string + var typeVar TypeBasicIntegrationRuntimeStatus err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - plh.Type = &typeVar + shirs.Type = typeVar } } } @@ -4270,216 +8161,178 @@ func (plh *PrivateLinkHub) UnmarshalJSON(body []byte) error { return nil } -// PrivateLinkHubInfoListResult list of privateLinkHubs -type PrivateLinkHubInfoListResult struct { - autorest.Response `json:"-"` - // NextLink - Link to the next page of results - NextLink *string `json:"nextLink,omitempty"` - // Value - List of privateLinkHubs - Value *[]PrivateLinkHub `json:"value,omitempty"` -} - -// PrivateLinkHubInfoListResultIterator provides access to a complete listing of PrivateLinkHub values. -type PrivateLinkHubInfoListResultIterator struct { - i int - page PrivateLinkHubInfoListResultPage -} - -// 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 *PrivateLinkHubInfoListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubInfoListResultIterator.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 *PrivateLinkHubInfoListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateLinkHubInfoListResultIterator) 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 PrivateLinkHubInfoListResultIterator) Response() PrivateLinkHubInfoListResult { - 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 PrivateLinkHubInfoListResultIterator) Value() PrivateLinkHub { - if !iter.page.NotDone() { - return PrivateLinkHub{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateLinkHubInfoListResultIterator type. -func NewPrivateLinkHubInfoListResultIterator(page PrivateLinkHubInfoListResultPage) PrivateLinkHubInfoListResultIterator { - return PrivateLinkHubInfoListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (plhilr PrivateLinkHubInfoListResult) IsEmpty() bool { - return plhilr.Value == nil || len(*plhilr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (plhilr PrivateLinkHubInfoListResult) hasNextLink() bool { - return plhilr.NextLink != nil && len(*plhilr.NextLink) != 0 -} - -// privateLinkHubInfoListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (plhilr PrivateLinkHubInfoListResult) privateLinkHubInfoListResultPreparer(ctx context.Context) (*http.Request, error) { - if !plhilr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(plhilr.NextLink))) -} - -// PrivateLinkHubInfoListResultPage contains a page of PrivateLinkHub values. -type PrivateLinkHubInfoListResultPage struct { - fn func(context.Context, PrivateLinkHubInfoListResult) (PrivateLinkHubInfoListResult, error) - plhilr PrivateLinkHubInfoListResult -} - -// 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 *PrivateLinkHubInfoListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubInfoListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.plhilr) - if err != nil { - return err - } - page.plhilr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PrivateLinkHubInfoListResultPage) Next() error { - return page.NextWithContext(context.Background()) +// SelfHostedIntegrationRuntimeStatusTypeProperties self-hosted integration runtime status type properties. +type SelfHostedIntegrationRuntimeStatusTypeProperties struct { + // CreateTime - READ-ONLY; The time at which the integration runtime was created, in ISO8601 format. + CreateTime *date.Time `json:"createTime,omitempty"` + // TaskQueueID - READ-ONLY; The task queue id of the integration runtime. + TaskQueueID *string `json:"taskQueueId,omitempty"` + // NodeCommunicationChannelEncryptionMode - READ-ONLY; The node communication Channel encryption mode + NodeCommunicationChannelEncryptionMode *string `json:"nodeCommunicationChannelEncryptionMode,omitempty"` + // InternalChannelEncryption - READ-ONLY; It is used to set the encryption mode for node-node communication channel (when more than 2 self-hosted integration runtime nodes exist). Possible values include: 'NotSet', 'SslEncrypted', 'NotEncrypted' + InternalChannelEncryption IntegrationRuntimeInternalChannelEncryptionMode `json:"internalChannelEncryption,omitempty"` + // Version - READ-ONLY; Version of the integration runtime. + Version *string `json:"version,omitempty"` + // Nodes - The list of nodes for this integration runtime. + Nodes *[]SelfHostedIntegrationRuntimeNode `json:"nodes,omitempty"` + // ScheduledUpdateDate - READ-ONLY; The date at which the integration runtime will be scheduled to update, in ISO8601 format. + ScheduledUpdateDate *date.Time `json:"scheduledUpdateDate,omitempty"` + // UpdateDelayOffset - READ-ONLY; The time in the date scheduled by service to update the integration runtime, e.g., PT03H is 3 hours + UpdateDelayOffset *string `json:"updateDelayOffset,omitempty"` + // LocalTimeZoneOffset - READ-ONLY; The local time zone offset in hours. + LocalTimeZoneOffset *string `json:"localTimeZoneOffset,omitempty"` + // Capabilities - READ-ONLY; Object with additional information about integration runtime capabilities. + Capabilities map[string]*string `json:"capabilities"` + // ServiceUrls - READ-ONLY; The URLs for the services used in integration runtime backend service. + ServiceUrls *[]string `json:"serviceUrls,omitempty"` + // AutoUpdate - READ-ONLY; Whether Self-hosted integration runtime auto update has been turned on. Possible values include: 'On', 'Off' + AutoUpdate IntegrationRuntimeAutoUpdate `json:"autoUpdate,omitempty"` + // VersionStatus - READ-ONLY; Status of the integration runtime version. + VersionStatus *string `json:"versionStatus,omitempty"` + // Links - The list of linked integration runtimes that are created to share with this integration runtime. + Links *[]LinkedIntegrationRuntime `json:"links,omitempty"` + // PushedVersion - READ-ONLY; The version that the integration runtime is going to update to. + PushedVersion *string `json:"pushedVersion,omitempty"` + // LatestVersion - READ-ONLY; The latest version on download center. + LatestVersion *string `json:"latestVersion,omitempty"` + // AutoUpdateETA - READ-ONLY; The estimated time when the self-hosted integration runtime will be updated. + AutoUpdateETA *date.Time `json:"autoUpdateETA,omitempty"` } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateLinkHubInfoListResultPage) NotDone() bool { - return !page.plhilr.IsEmpty() +// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntimeStatusTypeProperties. +func (shirstp SelfHostedIntegrationRuntimeStatusTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if shirstp.Nodes != nil { + objectMap["nodes"] = shirstp.Nodes + } + if shirstp.Links != nil { + objectMap["links"] = shirstp.Links + } + return json.Marshal(objectMap) } -// Response returns the raw server response from the last page request. -func (page PrivateLinkHubInfoListResultPage) Response() PrivateLinkHubInfoListResult { - return page.plhilr +// SelfHostedIntegrationRuntimeTypeProperties the self-hosted integration runtime properties. +type SelfHostedIntegrationRuntimeTypeProperties struct { + // LinkedInfo - Linked integration runtime type from data factory + LinkedInfo BasicLinkedIntegrationRuntimeType `json:"linkedInfo,omitempty"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateLinkHubInfoListResultPage) Values() []PrivateLinkHub { - if page.plhilr.IsEmpty() { - return nil +// UnmarshalJSON is the custom unmarshaler for SelfHostedIntegrationRuntimeTypeProperties struct. +func (shirtp *SelfHostedIntegrationRuntimeTypeProperties) 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 "linkedInfo": + if v != nil { + linkedInfo, err := unmarshalBasicLinkedIntegrationRuntimeType(*v) + if err != nil { + return err + } + shirtp.LinkedInfo = linkedInfo + } + } } - return *page.plhilr.Value -} -// Creates a new instance of the PrivateLinkHubInfoListResultPage type. -func NewPrivateLinkHubInfoListResultPage(getNextPage func(context.Context, PrivateLinkHubInfoListResult) (PrivateLinkHubInfoListResult, error)) PrivateLinkHubInfoListResultPage { - return PrivateLinkHubInfoListResultPage{fn: getNextPage} + return nil } -// PrivateLinkHubPatchInfo privateLinkHub patch details -type PrivateLinkHubPatchInfo struct { - // Tags - Resource tags - Tags map[string]*string `json:"tags"` +// SensitivityLabel a sensitivity label. +type SensitivityLabel struct { + autorest.Response `json:"-"` + // SensitivityLabelProperties - Resource properties. + *SensitivityLabelProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for PrivateLinkHubPatchInfo. -func (plhpi PrivateLinkHubPatchInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SensitivityLabel. +func (sl SensitivityLabel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if plhpi.Tags != nil { - objectMap["tags"] = plhpi.Tags + if sl.SensitivityLabelProperties != nil { + objectMap["properties"] = sl.SensitivityLabelProperties } return json.Marshal(objectMap) } -// PrivateLinkHubProperties privateLinkHub properties -type PrivateLinkHubProperties struct { - // ProvisioningState - READ-ONLY; PrivateLinkHub provisioning state. Possible values include: 'ProvisioningState1Succeeded', 'ProvisioningState1Failed' - ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` -} +// UnmarshalJSON is the custom unmarshaler for SensitivityLabel struct. +func (sl *SensitivityLabel) 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 sensitivityLabelProperties SensitivityLabelProperties + err = json.Unmarshal(*v, &sensitivityLabelProperties) + if err != nil { + return err + } + sl.SensitivityLabelProperties = &sensitivityLabelProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sl.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sl.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sl.Type = &typeVar + } + } + } -// PrivateLinkResource a private link resource -type PrivateLinkResource struct { - autorest.Response `json:"-"` - // Properties - READ-ONLY; The private link resource properties. - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` + return nil } -// PrivateLinkResourceListResult a list of private link resources -type PrivateLinkResourceListResult struct { +// SensitivityLabelListResult a list of sensitivity labels. +type SensitivityLabelListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; Array of results. - Value *[]PrivateLinkResource `json:"value,omitempty"` + Value *[]SensitivityLabel `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } -// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource values. -type PrivateLinkResourceListResultIterator struct { +// SensitivityLabelListResultIterator provides access to a complete listing of SensitivityLabel values. +type SensitivityLabelListResultIterator struct { i int - page PrivateLinkResourceListResultPage + page SensitivityLabelListResultPage } // 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 *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *SensitivityLabelListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -4504,238 +8357,177 @@ func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.C // 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 *PrivateLinkResourceListResultIterator) Next() error { +func (iter *SensitivityLabelListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateLinkResourceListResultIterator) NotDone() bool { +func (iter SensitivityLabelListResultIterator) 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 PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult { +func (iter SensitivityLabelListResultIterator) Response() SensitivityLabelListResult { 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 PrivateLinkResourceListResultIterator) Value() PrivateLinkResource { +func (iter SensitivityLabelListResultIterator) Value() SensitivityLabel { if !iter.page.NotDone() { - return PrivateLinkResource{} + return SensitivityLabel{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the PrivateLinkResourceListResultIterator type. -func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator { - return PrivateLinkResourceListResultIterator{page: page} +// Creates a new instance of the SensitivityLabelListResultIterator type. +func NewSensitivityLabelListResultIterator(page SensitivityLabelListResultPage) SensitivityLabelListResultIterator { + return SensitivityLabelListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (plrlr PrivateLinkResourceListResult) IsEmpty() bool { - return plrlr.Value == nil || len(*plrlr.Value) == 0 +func (sllr SensitivityLabelListResult) IsEmpty() bool { + return sllr.Value == nil || len(*sllr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (plrlr PrivateLinkResourceListResult) hasNextLink() bool { - return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0 +func (sllr SensitivityLabelListResult) hasNextLink() bool { + return sllr.NextLink != nil && len(*sllr.NextLink) != 0 } -// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results. +// sensitivityLabelListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !plrlr.hasNextLink() { +func (sllr SensitivityLabelListResult) sensitivityLabelListResultPreparer(ctx context.Context) (*http.Request, error) { + if !sllr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(plrlr.NextLink))) -} - -// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values. -type PrivateLinkResourceListResultPage struct { - fn func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error) - plrlr PrivateLinkResourceListResult -} - -// 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 *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.plrlr) - if err != nil { - return err - } - page.plrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PrivateLinkResourceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateLinkResourceListResultPage) NotDone() bool { - return !page.plrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult { - return page.plrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource { - if page.plrlr.IsEmpty() { - return nil - } - return *page.plrlr.Value -} - -// Creates a new instance of the PrivateLinkResourceListResultPage type. -func NewPrivateLinkResourceListResultPage(getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage { - return PrivateLinkResourceListResultPage{fn: getNextPage} -} - -// PrivateLinkResourceProperties properties of a private link resource. -type PrivateLinkResourceProperties struct { - // GroupID - READ-ONLY; The private link resource group id. - GroupID *string `json:"groupId,omitempty"` - // RequiredMembers - READ-ONLY; The private link resource required member names. - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - // RequiredZoneNames - READ-ONLY; Required DNS zone names of the the private link resource. - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` + autorest.WithBaseURL(to.String(sllr.NextLink))) } -// PrivateLinkServiceConnectionState connection state details of the private endpoint -type PrivateLinkServiceConnectionState struct { - // Status - The private link service connection status. Possible values include: 'StatusApproved', 'StatusPending', 'StatusRejected', 'StatusDisconnected' - Status Status `json:"status,omitempty"` - // Description - The private link service connection description. - Description *string `json:"description,omitempty"` - // ActionsRequired - READ-ONLY; The actions required for private link service connection. - ActionsRequired *string `json:"actionsRequired,omitempty"` +// SensitivityLabelListResultPage contains a page of SensitivityLabel values. +type SensitivityLabelListResultPage struct { + fn func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error) + sllr SensitivityLabelListResult } -// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionState. -func (plscs PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plscs.Status != "" { - objectMap["status"] = plscs.Status +// 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 *SensitivityLabelListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if plscs.Description != nil { - objectMap["description"] = plscs.Description + for { + next, err := page.fn(ctx, page.sllr) + if err != nil { + return err + } + page.sllr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - return json.Marshal(objectMap) + return nil } -// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than -// required location and tags -type ProxyResource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` +// 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 *SensitivityLabelListResultPage) Next() error { + return page.NextWithContext(context.Background()) } -// QueryInterval a database query. -type QueryInterval struct { - // IntervalStartTime - READ-ONLY; The start time of the measurement interval (ISO8601 format). - IntervalStartTime *date.Time `json:"intervalStartTime,omitempty"` - // ExecutionCount - READ-ONLY; The number of times the query was executed during this interval. - ExecutionCount *float64 `json:"executionCount,omitempty"` - // Metrics - READ-ONLY; The list of query metrics during this interval. - Metrics *[]QueryMetric `json:"metrics,omitempty"` +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SensitivityLabelListResultPage) NotDone() bool { + return !page.sllr.IsEmpty() } -// QueryMetric a database query. -type QueryMetric struct { - // Name - READ-ONLY; The name of the metric - Name *string `json:"name,omitempty"` - // DisplayName - READ-ONLY; The name of the metric for display in user interface - DisplayName *string `json:"displayName,omitempty"` - // Unit - READ-ONLY; The unit of measurement. Possible values include: 'Percentage', 'KB', 'Microseconds' - Unit QueryMetricUnit `json:"unit,omitempty"` - // Value - READ-ONLY; The measured value - Value *float64 `json:"value,omitempty"` +// Response returns the raw server response from the last page request. +func (page SensitivityLabelListResultPage) Response() SensitivityLabelListResult { + return page.sllr } -// QueryStatistic a database query. -type QueryStatistic struct { - // QueryID - READ-ONLY; The id of the query - QueryID *string `json:"queryId,omitempty"` - // Intervals - READ-ONLY; The list of query intervals. - Intervals *[]QueryInterval `json:"intervals,omitempty"` +// Values returns the slice of values for the current page or nil if there are no values. +func (page SensitivityLabelListResultPage) Values() []SensitivityLabel { + if page.sllr.IsEmpty() { + return nil + } + return *page.sllr.Value } -// ReplaceAllFirewallRulesOperationResponse an existing operation for replacing the firewall rules -type ReplaceAllFirewallRulesOperationResponse struct { - autorest.Response `json:"-"` - // OperationID - The operation ID - OperationID *string `json:"operationId,omitempty"` +// Creates a new instance of the SensitivityLabelListResultPage type. +func NewSensitivityLabelListResultPage(cur SensitivityLabelListResult, getNextPage func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error)) SensitivityLabelListResultPage { + return SensitivityLabelListResultPage{ + fn: getNextPage, + sllr: cur, + } } -// ReplaceAllIPFirewallRulesRequest replace all IP firewall rules request -type ReplaceAllIPFirewallRulesRequest struct { - // IPFirewallRules - IP firewall rule properties - IPFirewallRules map[string]*IPFirewallRuleProperties `json:"ipFirewallRules"` +// SensitivityLabelProperties properties of a sensitivity label. +type SensitivityLabelProperties struct { + // LabelName - The label name. + LabelName *string `json:"labelName,omitempty"` + // LabelID - The label ID. + LabelID *string `json:"labelId,omitempty"` + // InformationType - The information type. + InformationType *string `json:"informationType,omitempty"` + // InformationTypeID - The information type ID. + InformationTypeID *string `json:"informationTypeId,omitempty"` + // IsDisabled - READ-ONLY; Is sensitivity recommendation disabled. Applicable for recommended sensitivity label only. Specifies whether the sensitivity recommendation on this column is disabled (dismissed) or not. + IsDisabled *bool `json:"isDisabled,omitempty"` } -// MarshalJSON is the custom marshaler for ReplaceAllIPFirewallRulesRequest. -func (raifrr ReplaceAllIPFirewallRulesRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SensitivityLabelProperties. +func (slp SensitivityLabelProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if raifrr.IPFirewallRules != nil { - objectMap["ipFirewallRules"] = raifrr.IPFirewallRules + if slp.LabelName != nil { + objectMap["labelName"] = slp.LabelName + } + if slp.LabelID != nil { + objectMap["labelId"] = slp.LabelID + } + if slp.InformationType != nil { + objectMap["informationType"] = slp.InformationType + } + if slp.InformationTypeID != nil { + objectMap["informationTypeId"] = slp.InformationTypeID } return json.Marshal(objectMap) } -// ReplicationLink represents a Sql pool replication link. -type ReplicationLink struct { - // Location - READ-ONLY; Location of the workspace that contains this firewall rule. - Location *string `json:"location,omitempty"` - // ReplicationLinkProperties - The properties representing the resource. - *ReplicationLinkProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} +// ServerBlobAuditingPolicy a server blob auditing policy. +type ServerBlobAuditingPolicy struct { + autorest.Response `json:"-"` + // ServerBlobAuditingPolicyProperties - Resource properties. + *ServerBlobAuditingPolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ReplicationLink. -func (rl ReplicationLink) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServerBlobAuditingPolicy. +func (sbap ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if rl.ReplicationLinkProperties != nil { - objectMap["properties"] = rl.ReplicationLinkProperties + if sbap.ServerBlobAuditingPolicyProperties != nil { + objectMap["properties"] = sbap.ServerBlobAuditingPolicyProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ReplicationLink struct. -func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ServerBlobAuditingPolicy struct. +func (sbap *ServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4743,23 +8535,14 @@ func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rl.Location = &location - } case "properties": if v != nil { - var replicationLinkProperties ReplicationLinkProperties - err = json.Unmarshal(*v, &replicationLinkProperties) + var serverBlobAuditingPolicyProperties ServerBlobAuditingPolicyProperties + err = json.Unmarshal(*v, &serverBlobAuditingPolicyProperties) if err != nil { return err } - rl.ReplicationLinkProperties = &replicationLinkProperties + sbap.ServerBlobAuditingPolicyProperties = &serverBlobAuditingPolicyProperties } case "id": if v != nil { @@ -4768,7 +8551,7 @@ func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { if err != nil { return err } - rl.ID = &ID + sbap.ID = &ID } case "name": if v != nil { @@ -4777,7 +8560,7 @@ func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { if err != nil { return err } - rl.Name = &name + sbap.Name = &name } case "type": if v != nil { @@ -4786,7 +8569,7 @@ func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { if err != nil { return err } - rl.Type = &typeVar + sbap.Type = &typeVar } } } @@ -4794,35 +8577,27 @@ func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { return nil } -// ReplicationLinkListResult represents the response to a List Sql pool replication link request. -type ReplicationLinkListResult struct { +// ServerBlobAuditingPolicyListResult a list of server auditing settings. +type ServerBlobAuditingPolicyListResult struct { autorest.Response `json:"-"` - // Value - The list of Sql pool replication links housed in the Sql pool. - Value *[]ReplicationLink `json:"value,omitempty"` + // Value - READ-ONLY; Array of results. + Value *[]ServerBlobAuditingPolicy `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for ReplicationLinkListResult. -func (rllr ReplicationLinkListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rllr.Value != nil { - objectMap["value"] = rllr.Value - } - return json.Marshal(objectMap) -} - -// ReplicationLinkListResultIterator provides access to a complete listing of ReplicationLink values. -type ReplicationLinkListResultIterator struct { +// ServerBlobAuditingPolicyListResultIterator provides access to a complete listing of +// ServerBlobAuditingPolicy values. +type ServerBlobAuditingPolicyListResultIterator struct { i int - page ReplicationLinkListResultPage + page ServerBlobAuditingPolicyListResultPage } // 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 *ReplicationLinkListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinkListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPolicyListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -4847,67 +8622,67 @@ func (iter *ReplicationLinkListResultIterator) NextWithContext(ctx context.Conte // 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 *ReplicationLinkListResultIterator) Next() error { +func (iter *ServerBlobAuditingPolicyListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ReplicationLinkListResultIterator) NotDone() bool { +func (iter ServerBlobAuditingPolicyListResultIterator) 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 ReplicationLinkListResultIterator) Response() ReplicationLinkListResult { +func (iter ServerBlobAuditingPolicyListResultIterator) Response() ServerBlobAuditingPolicyListResult { 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 ReplicationLinkListResultIterator) Value() ReplicationLink { +func (iter ServerBlobAuditingPolicyListResultIterator) Value() ServerBlobAuditingPolicy { if !iter.page.NotDone() { - return ReplicationLink{} + return ServerBlobAuditingPolicy{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ReplicationLinkListResultIterator type. -func NewReplicationLinkListResultIterator(page ReplicationLinkListResultPage) ReplicationLinkListResultIterator { - return ReplicationLinkListResultIterator{page: page} +// Creates a new instance of the ServerBlobAuditingPolicyListResultIterator type. +func NewServerBlobAuditingPolicyListResultIterator(page ServerBlobAuditingPolicyListResultPage) ServerBlobAuditingPolicyListResultIterator { + return ServerBlobAuditingPolicyListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (rllr ReplicationLinkListResult) IsEmpty() bool { - return rllr.Value == nil || len(*rllr.Value) == 0 +func (sbaplr ServerBlobAuditingPolicyListResult) IsEmpty() bool { + return sbaplr.Value == nil || len(*sbaplr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (rllr ReplicationLinkListResult) hasNextLink() bool { - return rllr.NextLink != nil && len(*rllr.NextLink) != 0 +func (sbaplr ServerBlobAuditingPolicyListResult) hasNextLink() bool { + return sbaplr.NextLink != nil && len(*sbaplr.NextLink) != 0 } -// replicationLinkListResultPreparer prepares a request to retrieve the next set of results. +// serverBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (rllr ReplicationLinkListResult) replicationLinkListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rllr.hasNextLink() { +func (sbaplr ServerBlobAuditingPolicyListResult) serverBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if !sbaplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(rllr.NextLink))) + autorest.WithBaseURL(to.String(sbaplr.NextLink))) } -// ReplicationLinkListResultPage contains a page of ReplicationLink values. -type ReplicationLinkListResultPage struct { - fn func(context.Context, ReplicationLinkListResult) (ReplicationLinkListResult, error) - rllr ReplicationLinkListResult +// ServerBlobAuditingPolicyListResultPage contains a page of ServerBlobAuditingPolicy values. +type ServerBlobAuditingPolicyListResultPage struct { + fn func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error) + sbaplr ServerBlobAuditingPolicyListResult } // 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 *ReplicationLinkListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *ServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinkListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPolicyListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -4917,11 +8692,11 @@ func (page *ReplicationLinkListResultPage) NextWithContext(ctx context.Context) }() } for { - next, err := page.fn(ctx, page.rllr) + next, err := page.fn(ctx, page.sbaplr) if err != nil { return err } - page.rllr = next + page.sbaplr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -4932,99 +8707,154 @@ func (page *ReplicationLinkListResultPage) NextWithContext(ctx context.Context) // 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 *ReplicationLinkListResultPage) Next() error { +func (page *ServerBlobAuditingPolicyListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ReplicationLinkListResultPage) NotDone() bool { - return !page.rllr.IsEmpty() +func (page ServerBlobAuditingPolicyListResultPage) NotDone() bool { + return !page.sbaplr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ReplicationLinkListResultPage) Response() ReplicationLinkListResult { - return page.rllr +func (page ServerBlobAuditingPolicyListResultPage) Response() ServerBlobAuditingPolicyListResult { + return page.sbaplr } // Values returns the slice of values for the current page or nil if there are no values. -func (page ReplicationLinkListResultPage) Values() []ReplicationLink { - if page.rllr.IsEmpty() { +func (page ServerBlobAuditingPolicyListResultPage) Values() []ServerBlobAuditingPolicy { + if page.sbaplr.IsEmpty() { return nil } - return *page.rllr.Value -} - -// Creates a new instance of the ReplicationLinkListResultPage type. -func NewReplicationLinkListResultPage(getNextPage func(context.Context, ReplicationLinkListResult) (ReplicationLinkListResult, error)) ReplicationLinkListResultPage { - return ReplicationLinkListResultPage{fn: getNextPage} -} - -// ReplicationLinkProperties represents the properties of a Sql pool replication link. -type ReplicationLinkProperties struct { - // IsTerminationAllowed - READ-ONLY; Legacy value indicating whether termination is allowed. Currently always returns true. - IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty"` - // ReplicationMode - READ-ONLY; Replication mode of this replication link. - ReplicationMode *string `json:"replicationMode,omitempty"` - // PartnerServer - READ-ONLY; The name of the workspace hosting the partner Sql pool. - PartnerServer *string `json:"partnerServer,omitempty"` - // PartnerDatabase - READ-ONLY; The name of the partner Sql pool. - PartnerDatabase *string `json:"partnerDatabase,omitempty"` - // PartnerLocation - READ-ONLY; The Azure Region of the partner Sql pool. - PartnerLocation *string `json:"partnerLocation,omitempty"` - // Role - READ-ONLY; The role of the Sql pool in the replication link. Possible values include: 'Primary', 'Secondary', 'NonReadableSecondary', 'Source', 'Copy' - Role ReplicationRole `json:"role,omitempty"` - // PartnerRole - READ-ONLY; The role of the partner Sql pool in the replication link. Possible values include: 'Primary', 'Secondary', 'NonReadableSecondary', 'Source', 'Copy' - PartnerRole ReplicationRole `json:"partnerRole,omitempty"` - // StartTime - READ-ONLY; The start time for the replication link. - StartTime *date.Time `json:"startTime,omitempty"` - // PercentComplete - READ-ONLY; The percentage of seeding complete for the replication link. - PercentComplete *int32 `json:"percentComplete,omitempty"` - // ReplicationState - READ-ONLY; The replication state for the replication link. Possible values include: 'PENDING', 'SEEDING', 'CATCHUP', 'SUSPENDED' - ReplicationState ReplicationState `json:"replicationState,omitempty"` + return *page.sbaplr.Value } -// Resource ... -type Resource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` +// Creates a new instance of the ServerBlobAuditingPolicyListResultPage type. +func NewServerBlobAuditingPolicyListResultPage(cur ServerBlobAuditingPolicyListResult, getNextPage func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error)) ServerBlobAuditingPolicyListResultPage { + return ServerBlobAuditingPolicyListResultPage{ + fn: getNextPage, + sbaplr: cur, + } } -// ResourceMoveDefinition contains the information necessary to perform a resource move (rename). -type ResourceMoveDefinition struct { - // ID - The target ID for the resource - ID *string `json:"id,omitempty"` +// ServerBlobAuditingPolicyProperties properties of a server blob auditing policy. +type ServerBlobAuditingPolicyProperties struct { + // State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled' + State BlobAuditingPolicyState `json:"state,omitempty"` + // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. + StorageEndpoint *string `json:"storageEndpoint,omitempty"` + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. + // If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + // Prerequisites for using managed identity authentication: + // 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + // For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. + RetentionDays *int32 `json:"retentionDays,omitempty"` + // AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit. + // + // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: + // + // BATCH_COMPLETED_GROUP, + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + // FAILED_DATABASE_AUTHENTICATION_GROUP. + // + // This above combination is also the set that is configured by default when enabling auditing from the Azure portal. + // + // The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + // + // APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + // BACKUP_RESTORE_GROUP + // DATABASE_LOGOUT_GROUP + // DATABASE_OBJECT_CHANGE_GROUP + // DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + // DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + // DATABASE_OPERATION_GROUP + // DATABASE_PERMISSION_CHANGE_GROUP + // DATABASE_PRINCIPAL_CHANGE_GROUP + // DATABASE_PRINCIPAL_IMPERSONATION_GROUP + // DATABASE_ROLE_MEMBER_CHANGE_GROUP + // FAILED_DATABASE_AUTHENTICATION_GROUP + // SCHEMA_OBJECT_ACCESS_GROUP + // SCHEMA_OBJECT_CHANGE_GROUP + // SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + // SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + // USER_CHANGE_PASSWORD_GROUP + // BATCH_STARTED_GROUP + // BATCH_COMPLETED_GROUP + // + // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. + // + // For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + // + // For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: + // SELECT + // UPDATE + // INSERT + // DELETE + // EXECUTE + // RECEIVE + // REFERENCES + // + // The general form for defining an action to be audited is: + // {action} ON {object} BY {principal} + // + // Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. + // + // For example: + // SELECT on dbo.myTable by public + // SELECT on DATABASE::myDatabase by public + // SELECT on SCHEMA::mySchema by public + // + // For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"` + // StorageAccountSubscriptionID - Specifies the blob storage subscription Id. + StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` + // IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key. + IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` + // IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor. + // In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. + // + // When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. + // Note that for server level audit you should use the 'master' database as {databaseName}. + // + // Diagnostic Settings URI format: + // PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + // + // For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) + // or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) + IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"` + // QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. + // The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. + QueueDelayMs *int32 `json:"queueDelayMs,omitempty"` } -// RestorePoint database restore points. -type RestorePoint struct { +// ServerSecurityAlertPolicy workspace managed Sql server security alert policy. +type ServerSecurityAlertPolicy struct { autorest.Response `json:"-"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // RestorePointProperties - Resource properties. - *RestorePointProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ServerSecurityAlertPolicyProperties - Resource properties. + *ServerSecurityAlertPolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for RestorePoint. -func (rp RestorePoint) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServerSecurityAlertPolicy. +func (ssap ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if rp.RestorePointProperties != nil { - objectMap["properties"] = rp.RestorePointProperties + if ssap.ServerSecurityAlertPolicyProperties != nil { + objectMap["properties"] = ssap.ServerSecurityAlertPolicyProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for RestorePoint struct. -func (rp *RestorePoint) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ServerSecurityAlertPolicy struct. +func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5032,23 +8862,14 @@ func (rp *RestorePoint) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rp.Location = &location - } case "properties": if v != nil { - var restorePointProperties RestorePointProperties - err = json.Unmarshal(*v, &restorePointProperties) + var serverSecurityAlertPolicyProperties ServerSecurityAlertPolicyProperties + err = json.Unmarshal(*v, &serverSecurityAlertPolicyProperties) if err != nil { return err } - rp.RestorePointProperties = &restorePointProperties + ssap.ServerSecurityAlertPolicyProperties = &serverSecurityAlertPolicyProperties } case "id": if v != nil { @@ -5057,7 +8878,7 @@ func (rp *RestorePoint) UnmarshalJSON(body []byte) error { if err != nil { return err } - rp.ID = &ID + ssap.ID = &ID } case "name": if v != nil { @@ -5066,7 +8887,7 @@ func (rp *RestorePoint) UnmarshalJSON(body []byte) error { if err != nil { return err } - rp.Name = &name + ssap.Name = &name } case "type": if v != nil { @@ -5075,7 +8896,7 @@ func (rp *RestorePoint) UnmarshalJSON(body []byte) error { if err != nil { return err } - rp.Type = &typeVar + ssap.Type = &typeVar } } } @@ -5083,26 +8904,28 @@ func (rp *RestorePoint) UnmarshalJSON(body []byte) error { return nil } -// RestorePointListResult a list of long term retention backups. -type RestorePointListResult struct { +// ServerSecurityAlertPolicyListResult a list of the workspace managed sql server's security alert +// policies. +type ServerSecurityAlertPolicyListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; Array of results. - Value *[]RestorePoint `json:"value,omitempty"` + Value *[]ServerSecurityAlertPolicy `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } -// RestorePointListResultIterator provides access to a complete listing of RestorePoint values. -type RestorePointListResultIterator struct { +// ServerSecurityAlertPolicyListResultIterator provides access to a complete listing of +// ServerSecurityAlertPolicy values. +type ServerSecurityAlertPolicyListResultIterator struct { i int - page RestorePointListResultPage + page ServerSecurityAlertPolicyListResultPage } // 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 *RestorePointListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ServerSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerSecurityAlertPolicyListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -5127,244 +8950,124 @@ func (iter *RestorePointListResultIterator) NextWithContext(ctx context.Context) // 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 *RestorePointListResultIterator) Next() error { +func (iter *ServerSecurityAlertPolicyListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RestorePointListResultIterator) NotDone() bool { +func (iter ServerSecurityAlertPolicyListResultIterator) 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 RestorePointListResultIterator) Response() RestorePointListResult { +func (iter ServerSecurityAlertPolicyListResultIterator) Response() ServerSecurityAlertPolicyListResult { 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 RestorePointListResultIterator) Value() RestorePoint { +func (iter ServerSecurityAlertPolicyListResultIterator) Value() ServerSecurityAlertPolicy { if !iter.page.NotDone() { - return RestorePoint{} + return ServerSecurityAlertPolicy{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the RestorePointListResultIterator type. -func NewRestorePointListResultIterator(page RestorePointListResultPage) RestorePointListResultIterator { - return RestorePointListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rplr RestorePointListResult) IsEmpty() bool { - return rplr.Value == nil || len(*rplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rplr RestorePointListResult) hasNextLink() bool { - return rplr.NextLink != nil && len(*rplr.NextLink) != 0 -} - -// restorePointListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rplr RestorePointListResult) restorePointListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rplr.NextLink))) -} - -// RestorePointListResultPage contains a page of RestorePoint values. -type RestorePointListResultPage struct { - fn func(context.Context, RestorePointListResult) (RestorePointListResult, error) - rplr RestorePointListResult -} - -// 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 *RestorePointListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rplr) - if err != nil { - return err - } - page.rplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RestorePointListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RestorePointListResultPage) NotDone() bool { - return !page.rplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RestorePointListResultPage) Response() RestorePointListResult { - return page.rplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RestorePointListResultPage) Values() []RestorePoint { - if page.rplr.IsEmpty() { - return nil - } - return *page.rplr.Value -} - -// Creates a new instance of the RestorePointListResultPage type. -func NewRestorePointListResultPage(getNextPage func(context.Context, RestorePointListResult) (RestorePointListResult, error)) RestorePointListResultPage { - return RestorePointListResultPage{fn: getNextPage} -} - -// RestorePointProperties properties of a database restore point -type RestorePointProperties struct { - // RestorePointType - READ-ONLY; The type of restore point. Possible values include: 'CONTINUOUS', 'DISCRETE' - RestorePointType RestorePointType `json:"restorePointType,omitempty"` - // EarliestRestoreDate - READ-ONLY; The earliest time to which this database can be restored - EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` - // RestorePointCreationDate - READ-ONLY; The time the backup was taken - RestorePointCreationDate *date.Time `json:"restorePointCreationDate,omitempty"` - // RestorePointLabel - READ-ONLY; The label of restore point for backup request by user - RestorePointLabel *string `json:"restorePointLabel,omitempty"` -} - -// BasicSecretBase the base definition of a secret type. -type BasicSecretBase interface { - AsSecureString() (*SecureString, bool) - AsSecretBase() (*SecretBase, bool) -} - -// SecretBase the base definition of a secret type. -type SecretBase struct { - // Type - Possible values include: 'TypeSecretBase', 'TypeSecureString' - Type TypeBasicSecretBase `json:"type,omitempty"` -} - -func unmarshalBasicSecretBase(body []byte) (BasicSecretBase, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["type"] { - case string(TypeSecureString): - var ss SecureString - err := json.Unmarshal(body, &ss) - return ss, err - default: - var sb SecretBase - err := json.Unmarshal(body, &sb) - return sb, err - } -} -func unmarshalBasicSecretBaseArray(body []byte) ([]BasicSecretBase, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - sbArray := make([]BasicSecretBase, len(rawMessages)) - - for index, rawMessage := range rawMessages { - sb, err := unmarshalBasicSecretBase(*rawMessage) - if err != nil { - return nil, err - } - sbArray[index] = sb - } - return sbArray, nil -} - -// MarshalJSON is the custom marshaler for SecretBase. -func (sb SecretBase) MarshalJSON() ([]byte, error) { - sb.Type = TypeSecretBase - objectMap := make(map[string]interface{}) - if sb.Type != "" { - objectMap["type"] = sb.Type - } - return json.Marshal(objectMap) -} - -// AsSecureString is the BasicSecretBase implementation for SecretBase. -func (sb SecretBase) AsSecureString() (*SecureString, bool) { - return nil, false +// Creates a new instance of the ServerSecurityAlertPolicyListResultIterator type. +func NewServerSecurityAlertPolicyListResultIterator(page ServerSecurityAlertPolicyListResultPage) ServerSecurityAlertPolicyListResultIterator { + return ServerSecurityAlertPolicyListResultIterator{page: page} } -// AsSecretBase is the BasicSecretBase implementation for SecretBase. -func (sb SecretBase) AsSecretBase() (*SecretBase, bool) { - return &sb, true +// IsEmpty returns true if the ListResult contains no values. +func (ssaplr ServerSecurityAlertPolicyListResult) IsEmpty() bool { + return ssaplr.Value == nil || len(*ssaplr.Value) == 0 } -// AsBasicSecretBase is the BasicSecretBase implementation for SecretBase. -func (sb SecretBase) AsBasicSecretBase() (BasicSecretBase, bool) { - return &sb, true +// hasNextLink returns true if the NextLink is not empty. +func (ssaplr ServerSecurityAlertPolicyListResult) hasNextLink() bool { + return ssaplr.NextLink != nil && len(*ssaplr.NextLink) != 0 } -// SecureString azure Synapse secure string definition. The string value will be masked with asterisks '*' -// during Get or List API calls. -type SecureString struct { - // Value - Value of secure string. - Value *string `json:"value,omitempty"` - // Type - Possible values include: 'TypeSecretBase', 'TypeSecureString' - Type TypeBasicSecretBase `json:"type,omitempty"` +// serverSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssaplr ServerSecurityAlertPolicyListResult) serverSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ssaplr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssaplr.NextLink))) } -// MarshalJSON is the custom marshaler for SecureString. -func (ss SecureString) MarshalJSON() ([]byte, error) { - ss.Type = TypeSecureString - objectMap := make(map[string]interface{}) - if ss.Value != nil { - objectMap["value"] = ss.Value +// ServerSecurityAlertPolicyListResultPage contains a page of ServerSecurityAlertPolicy values. +type ServerSecurityAlertPolicyListResultPage struct { + fn func(context.Context, ServerSecurityAlertPolicyListResult) (ServerSecurityAlertPolicyListResult, error) + ssaplr ServerSecurityAlertPolicyListResult +} + +// 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 *ServerSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerSecurityAlertPolicyListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if ss.Type != "" { - objectMap["type"] = ss.Type + for { + next, err := page.fn(ctx, page.ssaplr) + if err != nil { + return err + } + page.ssaplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - return json.Marshal(objectMap) + return nil } -// AsSecureString is the BasicSecretBase implementation for SecureString. -func (ss SecureString) AsSecureString() (*SecureString, bool) { - return &ss, true +// 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 *ServerSecurityAlertPolicyListResultPage) Next() error { + return page.NextWithContext(context.Background()) } -// AsSecretBase is the BasicSecretBase implementation for SecureString. -func (ss SecureString) AsSecretBase() (*SecretBase, bool) { - return nil, false +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServerSecurityAlertPolicyListResultPage) NotDone() bool { + return !page.ssaplr.IsEmpty() } -// AsBasicSecretBase is the BasicSecretBase implementation for SecureString. -func (ss SecureString) AsBasicSecretBase() (BasicSecretBase, bool) { - return &ss, true +// Response returns the raw server response from the last page request. +func (page ServerSecurityAlertPolicyListResultPage) Response() ServerSecurityAlertPolicyListResult { + return page.ssaplr } -// SecurityAlertPolicyProperties properties of a security alert policy. -type SecurityAlertPolicyProperties struct { - // State - Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific Sql pool. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled' +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServerSecurityAlertPolicyListResultPage) Values() []ServerSecurityAlertPolicy { + if page.ssaplr.IsEmpty() { + return nil + } + return *page.ssaplr.Value +} + +// Creates a new instance of the ServerSecurityAlertPolicyListResultPage type. +func NewServerSecurityAlertPolicyListResultPage(cur ServerSecurityAlertPolicyListResult, getNextPage func(context.Context, ServerSecurityAlertPolicyListResult) (ServerSecurityAlertPolicyListResult, error)) ServerSecurityAlertPolicyListResultPage { + return ServerSecurityAlertPolicyListResultPage{ + fn: getNextPage, + ssaplr: cur, + } +} + +// ServerSecurityAlertPolicyProperties properties of a security alert policy. +type ServerSecurityAlertPolicyProperties struct { + // State - Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific server. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled' State SecurityAlertPolicyState `json:"state,omitempty"` // DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action DisabledAlerts *[]string `json:"disabledAlerts,omitempty"` @@ -5382,398 +9085,243 @@ type SecurityAlertPolicyProperties struct { CreationTime *date.Time `json:"creationTime,omitempty"` } -// MarshalJSON is the custom marshaler for SecurityAlertPolicyProperties. -func (sapp SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServerSecurityAlertPolicyProperties. +func (ssapp ServerSecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if sapp.State != "" { - objectMap["state"] = sapp.State + if ssapp.State != "" { + objectMap["state"] = ssapp.State } - if sapp.DisabledAlerts != nil { - objectMap["disabledAlerts"] = sapp.DisabledAlerts + if ssapp.DisabledAlerts != nil { + objectMap["disabledAlerts"] = ssapp.DisabledAlerts } - if sapp.EmailAddresses != nil { - objectMap["emailAddresses"] = sapp.EmailAddresses + if ssapp.EmailAddresses != nil { + objectMap["emailAddresses"] = ssapp.EmailAddresses } - if sapp.EmailAccountAdmins != nil { - objectMap["emailAccountAdmins"] = sapp.EmailAccountAdmins + if ssapp.EmailAccountAdmins != nil { + objectMap["emailAccountAdmins"] = ssapp.EmailAccountAdmins } - if sapp.StorageEndpoint != nil { - objectMap["storageEndpoint"] = sapp.StorageEndpoint + if ssapp.StorageEndpoint != nil { + objectMap["storageEndpoint"] = ssapp.StorageEndpoint } - if sapp.StorageAccountAccessKey != nil { - objectMap["storageAccountAccessKey"] = sapp.StorageAccountAccessKey + if ssapp.StorageAccountAccessKey != nil { + objectMap["storageAccountAccessKey"] = ssapp.StorageAccountAccessKey } - if sapp.RetentionDays != nil { - objectMap["retentionDays"] = sapp.RetentionDays + if ssapp.RetentionDays != nil { + objectMap["retentionDays"] = ssapp.RetentionDays } return json.Marshal(objectMap) } -// SelfHostedIntegrationRuntime self-hosted integration runtime. -type SelfHostedIntegrationRuntime struct { - // SelfHostedIntegrationRuntimeTypeProperties - When this property is not null, means this is a linked integration runtime. The property is used to access original integration runtime. - *SelfHostedIntegrationRuntimeTypeProperties `json:"typeProperties,omitempty"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // Description - Integration runtime description. - Description *string `json:"description,omitempty"` - // Type - Possible values include: 'TypeIntegrationRuntime', 'TypeManaged', 'TypeSelfHosted' - Type Type `json:"type,omitempty"` +// ServerUsage represents server metrics. +type ServerUsage struct { + // Name - READ-ONLY; Name of the server usage metric. + Name *string `json:"name,omitempty"` + // ResourceName - READ-ONLY; The name of the resource. + ResourceName *string `json:"resourceName,omitempty"` + // DisplayName - READ-ONLY; The metric display name. + DisplayName *string `json:"displayName,omitempty"` + // CurrentValue - READ-ONLY; The current value of the metric. + CurrentValue *float64 `json:"currentValue,omitempty"` + // Limit - READ-ONLY; The current limit of the metric. + Limit *float64 `json:"limit,omitempty"` + // Unit - READ-ONLY; The units of the metric. + Unit *string `json:"unit,omitempty"` + // NextResetTime - READ-ONLY; The next reset time for the metric (ISO8601 format). + NextResetTime *date.Time `json:"nextResetTime,omitempty"` } -// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntime. -func (shir SelfHostedIntegrationRuntime) MarshalJSON() ([]byte, error) { - shir.Type = TypeSelfHosted +// ServerUsageListResult represents the response to a list server metrics request. +type ServerUsageListResult struct { + autorest.Response `json:"-"` + // Value - The list of server metrics for the server. + Value *[]ServerUsage `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerUsageListResult. +func (sulr ServerUsageListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if shir.SelfHostedIntegrationRuntimeTypeProperties != nil { - objectMap["typeProperties"] = shir.SelfHostedIntegrationRuntimeTypeProperties - } - if shir.Description != nil { - objectMap["description"] = shir.Description - } - if shir.Type != "" { - objectMap["type"] = shir.Type - } - for k, v := range shir.AdditionalProperties { - objectMap[k] = v + if sulr.Value != nil { + objectMap["value"] = sulr.Value } return json.Marshal(objectMap) } -// AsManagedIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime. -func (shir SelfHostedIntegrationRuntime) AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) { - return nil, false -} - -// AsSelfHostedIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime. -func (shir SelfHostedIntegrationRuntime) AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) { - return &shir, true -} - -// AsIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime. -func (shir SelfHostedIntegrationRuntime) AsIntegrationRuntime() (*IntegrationRuntime, bool) { - return nil, false -} - -// AsBasicIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime. -func (shir SelfHostedIntegrationRuntime) AsBasicIntegrationRuntime() (BasicIntegrationRuntime, bool) { - return &shir, true +// ServerUsageListResultIterator provides access to a complete listing of ServerUsage values. +type ServerUsageListResultIterator struct { + i int + page ServerUsageListResultPage } -// UnmarshalJSON is the custom unmarshaler for SelfHostedIntegrationRuntime struct. -func (shir *SelfHostedIntegrationRuntime) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// 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 *ServerUsageListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerUsageListResultIterator.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 } - for k, v := range m { - switch k { - case "typeProperties": - if v != nil { - var selfHostedIntegrationRuntimeTypeProperties SelfHostedIntegrationRuntimeTypeProperties - err = json.Unmarshal(*v, &selfHostedIntegrationRuntimeTypeProperties) - if err != nil { - return err - } - shir.SelfHostedIntegrationRuntimeTypeProperties = &selfHostedIntegrationRuntimeTypeProperties - } - default: - if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) - if err != nil { - return err - } - if shir.AdditionalProperties == nil { - shir.AdditionalProperties = make(map[string]interface{}) - } - shir.AdditionalProperties[k] = additionalProperties - } - case "description": - if v != nil { - var description string - err = json.Unmarshal(*v, &description) - if err != nil { - return err - } - shir.Description = &description - } - case "type": - if v != nil { - var typeVar Type - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - shir.Type = typeVar - } - } - } - + iter.i = 0 return nil } -// SelfHostedIntegrationRuntimeNode properties of Self-hosted integration runtime node. -type SelfHostedIntegrationRuntimeNode struct { - autorest.Response `json:"-"` - // NodeName - READ-ONLY; Name of the integration runtime node. - NodeName *string `json:"nodeName,omitempty"` - // MachineName - READ-ONLY; Machine name of the integration runtime node. - MachineName *string `json:"machineName,omitempty"` - // HostServiceURI - READ-ONLY; URI for the host machine of the integration runtime. - HostServiceURI *string `json:"hostServiceUri,omitempty"` - // Status - READ-ONLY; Status of the integration runtime node. Possible values include: 'SelfHostedIntegrationRuntimeNodeStatusNeedRegistration', 'SelfHostedIntegrationRuntimeNodeStatusOnline', 'SelfHostedIntegrationRuntimeNodeStatusLimited', 'SelfHostedIntegrationRuntimeNodeStatusOffline', 'SelfHostedIntegrationRuntimeNodeStatusUpgrading', 'SelfHostedIntegrationRuntimeNodeStatusInitializing', 'SelfHostedIntegrationRuntimeNodeStatusInitializeFailed' - Status SelfHostedIntegrationRuntimeNodeStatus `json:"status,omitempty"` - // Capabilities - READ-ONLY; The integration runtime capabilities dictionary - Capabilities map[string]*string `json:"capabilities"` - // VersionStatus - READ-ONLY; Status of the integration runtime node version. - VersionStatus *string `json:"versionStatus,omitempty"` - // Version - READ-ONLY; Version of the integration runtime node. - Version *string `json:"version,omitempty"` - // RegisterTime - READ-ONLY; The time at which the integration runtime node was registered in ISO8601 format. - RegisterTime *date.Time `json:"registerTime,omitempty"` - // LastConnectTime - READ-ONLY; The most recent time at which the integration runtime was connected in ISO8601 format. - LastConnectTime *date.Time `json:"lastConnectTime,omitempty"` - // ExpiryTime - READ-ONLY; The time at which the integration runtime will expire in ISO8601 format. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // LastStartTime - READ-ONLY; The time the node last started up. - LastStartTime *date.Time `json:"lastStartTime,omitempty"` - // LastStopTime - READ-ONLY; The integration runtime node last stop time. - LastStopTime *date.Time `json:"lastStopTime,omitempty"` - // LastUpdateResult - READ-ONLY; The result of the last integration runtime node update. Possible values include: 'None', 'Succeed', 'Fail' - LastUpdateResult IntegrationRuntimeUpdateResult `json:"lastUpdateResult,omitempty"` - // LastStartUpdateTime - READ-ONLY; The last time for the integration runtime node update start. - LastStartUpdateTime *date.Time `json:"lastStartUpdateTime,omitempty"` - // LastEndUpdateTime - READ-ONLY; The last time for the integration runtime node update end. - LastEndUpdateTime *date.Time `json:"lastEndUpdateTime,omitempty"` - // IsActiveDispatcher - READ-ONLY; Indicates whether this node is the active dispatcher for integration runtime requests. - IsActiveDispatcher *bool `json:"isActiveDispatcher,omitempty"` - // ConcurrentJobsLimit - READ-ONLY; Maximum concurrent jobs on the integration runtime node. - ConcurrentJobsLimit *int32 `json:"concurrentJobsLimit,omitempty"` - // MaxConcurrentJobs - READ-ONLY; The maximum concurrent jobs in this integration runtime. - MaxConcurrentJobs *int32 `json:"maxConcurrentJobs,omitempty"` +// 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 *ServerUsageListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntimeNode. -func (shirn SelfHostedIntegrationRuntimeNode) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServerUsageListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// SelfHostedIntegrationRuntimeStatus self-hosted integration runtime status. -type SelfHostedIntegrationRuntimeStatus struct { - // SelfHostedIntegrationRuntimeStatusTypeProperties - Self-hosted integration runtime status type properties. - *SelfHostedIntegrationRuntimeStatusTypeProperties `json:"typeProperties,omitempty"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // DataFactoryName - READ-ONLY; The workspace name which the integration runtime belong to. - DataFactoryName *string `json:"dataFactoryName,omitempty"` - // State - READ-ONLY; The state of integration runtime. Possible values include: 'Initial', 'Stopped', 'Started', 'Starting', 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline', 'AccessDenied' - State IntegrationRuntimeState `json:"state,omitempty"` - // Type - Possible values include: 'TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus', 'TypeBasicIntegrationRuntimeStatusTypeManaged', 'TypeBasicIntegrationRuntimeStatusTypeSelfHosted' - Type TypeBasicIntegrationRuntimeStatus `json:"type,omitempty"` +// Response returns the raw server response from the last page request. +func (iter ServerUsageListResultIterator) Response() ServerUsageListResult { + return iter.page.Response() } -// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntimeStatus. -func (shirs SelfHostedIntegrationRuntimeStatus) MarshalJSON() ([]byte, error) { - shirs.Type = TypeBasicIntegrationRuntimeStatusTypeSelfHosted - objectMap := make(map[string]interface{}) - if shirs.SelfHostedIntegrationRuntimeStatusTypeProperties != nil { - objectMap["typeProperties"] = shirs.SelfHostedIntegrationRuntimeStatusTypeProperties - } - if shirs.Type != "" { - objectMap["type"] = shirs.Type - } - for k, v := range shirs.AdditionalProperties { - objectMap[k] = v +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ServerUsageListResultIterator) Value() ServerUsage { + if !iter.page.NotDone() { + return ServerUsage{} } - return json.Marshal(objectMap) + return iter.page.Values()[iter.i] } -// AsManagedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus. -func (shirs SelfHostedIntegrationRuntimeStatus) AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) { - return nil, false +// Creates a new instance of the ServerUsageListResultIterator type. +func NewServerUsageListResultIterator(page ServerUsageListResultPage) ServerUsageListResultIterator { + return ServerUsageListResultIterator{page: page} } -// AsSelfHostedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus. -func (shirs SelfHostedIntegrationRuntimeStatus) AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) { - return &shirs, true +// IsEmpty returns true if the ListResult contains no values. +func (sulr ServerUsageListResult) IsEmpty() bool { + return sulr.Value == nil || len(*sulr.Value) == 0 } -// AsIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus. -func (shirs SelfHostedIntegrationRuntimeStatus) AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) { - return nil, false +// hasNextLink returns true if the NextLink is not empty. +func (sulr ServerUsageListResult) hasNextLink() bool { + return sulr.NextLink != nil && len(*sulr.NextLink) != 0 } -// AsBasicIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus. -func (shirs SelfHostedIntegrationRuntimeStatus) AsBasicIntegrationRuntimeStatus() (BasicIntegrationRuntimeStatus, bool) { - return &shirs, true +// serverUsageListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sulr ServerUsageListResult) serverUsageListResultPreparer(ctx context.Context) (*http.Request, error) { + if !sulr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sulr.NextLink))) } -// UnmarshalJSON is the custom unmarshaler for SelfHostedIntegrationRuntimeStatus struct. -func (shirs *SelfHostedIntegrationRuntimeStatus) 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 "typeProperties": - if v != nil { - var selfHostedIntegrationRuntimeStatusTypeProperties SelfHostedIntegrationRuntimeStatusTypeProperties - err = json.Unmarshal(*v, &selfHostedIntegrationRuntimeStatusTypeProperties) - if err != nil { - return err - } - shirs.SelfHostedIntegrationRuntimeStatusTypeProperties = &selfHostedIntegrationRuntimeStatusTypeProperties - } - default: - if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) - if err != nil { - return err - } - if shirs.AdditionalProperties == nil { - shirs.AdditionalProperties = make(map[string]interface{}) - } - shirs.AdditionalProperties[k] = additionalProperties - } - case "dataFactoryName": - if v != nil { - var dataFactoryName string - err = json.Unmarshal(*v, &dataFactoryName) - if err != nil { - return err - } - shirs.DataFactoryName = &dataFactoryName - } - case "state": - if v != nil { - var state IntegrationRuntimeState - err = json.Unmarshal(*v, &state) - if err != nil { - return err - } - shirs.State = state - } - case "type": - if v != nil { - var typeVar TypeBasicIntegrationRuntimeStatus - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - shirs.Type = typeVar +// ServerUsageListResultPage contains a page of ServerUsage values. +type ServerUsageListResultPage struct { + fn func(context.Context, ServerUsageListResult) (ServerUsageListResult, error) + sulr ServerUsageListResult +} + +// 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 *ServerUsageListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerUsageListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sulr) + if err != nil { + return err + } + page.sulr = next + if !next.hasNextLink() || !next.IsEmpty() { + break } } - return nil } -// SelfHostedIntegrationRuntimeStatusTypeProperties self-hosted integration runtime status type properties. -type SelfHostedIntegrationRuntimeStatusTypeProperties struct { - // CreateTime - READ-ONLY; The time at which the integration runtime was created, in ISO8601 format. - CreateTime *date.Time `json:"createTime,omitempty"` - // TaskQueueID - READ-ONLY; The task queue id of the integration runtime. - TaskQueueID *string `json:"taskQueueId,omitempty"` - // InternalChannelEncryption - READ-ONLY; It is used to set the encryption mode for node-node communication channel (when more than 2 self-hosted integration runtime nodes exist). Possible values include: 'NotSet', 'SslEncrypted', 'NotEncrypted' - InternalChannelEncryption IntegrationRuntimeInternalChannelEncryptionMode `json:"internalChannelEncryption,omitempty"` - // Version - READ-ONLY; Version of the integration runtime. - Version *string `json:"version,omitempty"` - // Nodes - The list of nodes for this integration runtime. - Nodes *[]SelfHostedIntegrationRuntimeNode `json:"nodes,omitempty"` - // ScheduledUpdateDate - READ-ONLY; The date at which the integration runtime will be scheduled to update, in ISO8601 format. - ScheduledUpdateDate *date.Time `json:"scheduledUpdateDate,omitempty"` - // UpdateDelayOffset - READ-ONLY; The time in the date scheduled by service to update the integration runtime, e.g., PT03H is 3 hours - UpdateDelayOffset *string `json:"updateDelayOffset,omitempty"` - // LocalTimeZoneOffset - READ-ONLY; The local time zone offset in hours. - LocalTimeZoneOffset *string `json:"localTimeZoneOffset,omitempty"` - // Capabilities - READ-ONLY; Object with additional information about integration runtime capabilities. - Capabilities map[string]*string `json:"capabilities"` - // ServiceUrls - READ-ONLY; The URLs for the services used in integration runtime backend service. - ServiceUrls *[]string `json:"serviceUrls,omitempty"` - // AutoUpdate - READ-ONLY; Whether Self-hosted integration runtime auto update has been turned on. Possible values include: 'On', 'Off' - AutoUpdate IntegrationRuntimeAutoUpdate `json:"autoUpdate,omitempty"` - // VersionStatus - READ-ONLY; Status of the integration runtime version. - VersionStatus *string `json:"versionStatus,omitempty"` - // Links - The list of linked integration runtimes that are created to share with this integration runtime. - Links *[]LinkedIntegrationRuntime `json:"links,omitempty"` - // PushedVersion - READ-ONLY; The version that the integration runtime is going to update to. - PushedVersion *string `json:"pushedVersion,omitempty"` - // LatestVersion - READ-ONLY; The latest version on download center. - LatestVersion *string `json:"latestVersion,omitempty"` - // AutoUpdateETA - READ-ONLY; The estimated time when the self-hosted integration runtime will be updated. - AutoUpdateETA *date.Time `json:"autoUpdateETA,omitempty"` +// 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 *ServerUsageListResultPage) Next() error { + return page.NextWithContext(context.Background()) } -// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntimeStatusTypeProperties. -func (shirstp SelfHostedIntegrationRuntimeStatusTypeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if shirstp.Nodes != nil { - objectMap["nodes"] = shirstp.Nodes - } - if shirstp.Links != nil { - objectMap["links"] = shirstp.Links - } - return json.Marshal(objectMap) +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServerUsageListResultPage) NotDone() bool { + return !page.sulr.IsEmpty() } -// SelfHostedIntegrationRuntimeTypeProperties the self-hosted integration runtime properties. -type SelfHostedIntegrationRuntimeTypeProperties struct { - LinkedInfo BasicLinkedIntegrationRuntimeType `json:"linkedInfo,omitempty"` +// Response returns the raw server response from the last page request. +func (page ServerUsageListResultPage) Response() ServerUsageListResult { + return page.sulr } -// UnmarshalJSON is the custom unmarshaler for SelfHostedIntegrationRuntimeTypeProperties struct. -func (shirtp *SelfHostedIntegrationRuntimeTypeProperties) 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 "linkedInfo": - if v != nil { - linkedInfo, err := unmarshalBasicLinkedIntegrationRuntimeType(*v) - if err != nil { - return err - } - shirtp.LinkedInfo = linkedInfo - } - } +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServerUsageListResultPage) Values() []ServerUsage { + if page.sulr.IsEmpty() { + return nil } + return *page.sulr.Value +} - return nil +// Creates a new instance of the ServerUsageListResultPage type. +func NewServerUsageListResultPage(cur ServerUsageListResult, getNextPage func(context.Context, ServerUsageListResult) (ServerUsageListResult, error)) ServerUsageListResultPage { + return ServerUsageListResultPage{ + fn: getNextPage, + sulr: cur, + } } -// SensitivityLabel a sensitivity label. -type SensitivityLabel struct { +// ServerVulnerabilityAssessment a server vulnerability assessment. +type ServerVulnerabilityAssessment struct { autorest.Response `json:"-"` - // SensitivityLabelProperties - Resource properties. - *SensitivityLabelProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ServerVulnerabilityAssessmentProperties - Resource properties. + *ServerVulnerabilityAssessmentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for SensitivityLabel. -func (sl SensitivityLabel) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServerVulnerabilityAssessment. +func (sva ServerVulnerabilityAssessment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if sl.SensitivityLabelProperties != nil { - objectMap["properties"] = sl.SensitivityLabelProperties + if sva.ServerVulnerabilityAssessmentProperties != nil { + objectMap["properties"] = sva.ServerVulnerabilityAssessmentProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for SensitivityLabel struct. -func (sl *SensitivityLabel) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ServerVulnerabilityAssessment struct. +func (sva *ServerVulnerabilityAssessment) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5783,12 +9331,12 @@ func (sl *SensitivityLabel) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var sensitivityLabelProperties SensitivityLabelProperties - err = json.Unmarshal(*v, &sensitivityLabelProperties) + var serverVulnerabilityAssessmentProperties ServerVulnerabilityAssessmentProperties + err = json.Unmarshal(*v, &serverVulnerabilityAssessmentProperties) if err != nil { return err } - sl.SensitivityLabelProperties = &sensitivityLabelProperties + sva.ServerVulnerabilityAssessmentProperties = &serverVulnerabilityAssessmentProperties } case "id": if v != nil { @@ -5797,7 +9345,7 @@ func (sl *SensitivityLabel) UnmarshalJSON(body []byte) error { if err != nil { return err } - sl.ID = &ID + sva.ID = &ID } case "name": if v != nil { @@ -5806,7 +9354,7 @@ func (sl *SensitivityLabel) UnmarshalJSON(body []byte) error { if err != nil { return err } - sl.Name = &name + sva.Name = &name } case "type": if v != nil { @@ -5815,7 +9363,7 @@ func (sl *SensitivityLabel) UnmarshalJSON(body []byte) error { if err != nil { return err } - sl.Type = &typeVar + sva.Type = &typeVar } } } @@ -5823,26 +9371,27 @@ func (sl *SensitivityLabel) UnmarshalJSON(body []byte) error { return nil } -// SensitivityLabelListResult a list of sensitivity labels. -type SensitivityLabelListResult struct { +// ServerVulnerabilityAssessmentListResult a list of the server's vulnerability assessments. +type ServerVulnerabilityAssessmentListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; Array of results. - Value *[]SensitivityLabel `json:"value,omitempty"` + Value *[]ServerVulnerabilityAssessment `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } -// SensitivityLabelListResultIterator provides access to a complete listing of SensitivityLabel values. -type SensitivityLabelListResultIterator struct { +// ServerVulnerabilityAssessmentListResultIterator provides access to a complete listing of +// ServerVulnerabilityAssessment values. +type ServerVulnerabilityAssessmentListResultIterator struct { i int - page SensitivityLabelListResultPage + page ServerVulnerabilityAssessmentListResultPage } // 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 *SensitivityLabelListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ServerVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -5867,67 +9416,67 @@ func (iter *SensitivityLabelListResultIterator) NextWithContext(ctx context.Cont // 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 *SensitivityLabelListResultIterator) Next() error { +func (iter *ServerVulnerabilityAssessmentListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SensitivityLabelListResultIterator) NotDone() bool { +func (iter ServerVulnerabilityAssessmentListResultIterator) 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 SensitivityLabelListResultIterator) Response() SensitivityLabelListResult { +func (iter ServerVulnerabilityAssessmentListResultIterator) Response() ServerVulnerabilityAssessmentListResult { 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 SensitivityLabelListResultIterator) Value() SensitivityLabel { +func (iter ServerVulnerabilityAssessmentListResultIterator) Value() ServerVulnerabilityAssessment { if !iter.page.NotDone() { - return SensitivityLabel{} + return ServerVulnerabilityAssessment{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the SensitivityLabelListResultIterator type. -func NewSensitivityLabelListResultIterator(page SensitivityLabelListResultPage) SensitivityLabelListResultIterator { - return SensitivityLabelListResultIterator{page: page} +// Creates a new instance of the ServerVulnerabilityAssessmentListResultIterator type. +func NewServerVulnerabilityAssessmentListResultIterator(page ServerVulnerabilityAssessmentListResultPage) ServerVulnerabilityAssessmentListResultIterator { + return ServerVulnerabilityAssessmentListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (sllr SensitivityLabelListResult) IsEmpty() bool { - return sllr.Value == nil || len(*sllr.Value) == 0 +func (svalr ServerVulnerabilityAssessmentListResult) IsEmpty() bool { + return svalr.Value == nil || len(*svalr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (sllr SensitivityLabelListResult) hasNextLink() bool { - return sllr.NextLink != nil && len(*sllr.NextLink) != 0 +func (svalr ServerVulnerabilityAssessmentListResult) hasNextLink() bool { + return svalr.NextLink != nil && len(*svalr.NextLink) != 0 } -// sensitivityLabelListResultPreparer prepares a request to retrieve the next set of results. +// serverVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (sllr SensitivityLabelListResult) sensitivityLabelListResultPreparer(ctx context.Context) (*http.Request, error) { - if !sllr.hasNextLink() { +func (svalr ServerVulnerabilityAssessmentListResult) serverVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) { + if !svalr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(sllr.NextLink))) + autorest.WithBaseURL(to.String(svalr.NextLink))) } -// SensitivityLabelListResultPage contains a page of SensitivityLabel values. -type SensitivityLabelListResultPage struct { - fn func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error) - sllr SensitivityLabelListResult +// ServerVulnerabilityAssessmentListResultPage contains a page of ServerVulnerabilityAssessment values. +type ServerVulnerabilityAssessmentListResultPage struct { + fn func(context.Context, ServerVulnerabilityAssessmentListResult) (ServerVulnerabilityAssessmentListResult, error) + svalr ServerVulnerabilityAssessmentListResult } // 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 *SensitivityLabelListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *ServerVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -5937,11 +9486,11 @@ func (page *SensitivityLabelListResultPage) NextWithContext(ctx context.Context) }() } for { - next, err := page.fn(ctx, page.sllr) + next, err := page.fn(ctx, page.svalr) if err != nil { return err } - page.sllr = next + page.svalr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -5952,63 +9501,46 @@ func (page *SensitivityLabelListResultPage) NextWithContext(ctx context.Context) // 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 *SensitivityLabelListResultPage) Next() error { +func (page *ServerVulnerabilityAssessmentListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SensitivityLabelListResultPage) NotDone() bool { - return !page.sllr.IsEmpty() +func (page ServerVulnerabilityAssessmentListResultPage) NotDone() bool { + return !page.svalr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page SensitivityLabelListResultPage) Response() SensitivityLabelListResult { - return page.sllr +func (page ServerVulnerabilityAssessmentListResultPage) Response() ServerVulnerabilityAssessmentListResult { + return page.svalr } // Values returns the slice of values for the current page or nil if there are no values. -func (page SensitivityLabelListResultPage) Values() []SensitivityLabel { - if page.sllr.IsEmpty() { +func (page ServerVulnerabilityAssessmentListResultPage) Values() []ServerVulnerabilityAssessment { + if page.svalr.IsEmpty() { return nil } - return *page.sllr.Value -} - -// Creates a new instance of the SensitivityLabelListResultPage type. -func NewSensitivityLabelListResultPage(getNextPage func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error)) SensitivityLabelListResultPage { - return SensitivityLabelListResultPage{fn: getNextPage} + return *page.svalr.Value } -// SensitivityLabelProperties properties of a sensitivity label. -type SensitivityLabelProperties struct { - // LabelName - The label name. - LabelName *string `json:"labelName,omitempty"` - // LabelID - The label ID. - LabelID *string `json:"labelId,omitempty"` - // InformationType - The information type. - InformationType *string `json:"informationType,omitempty"` - // InformationTypeID - The information type ID. - InformationTypeID *string `json:"informationTypeId,omitempty"` - // IsDisabled - READ-ONLY; Is sensitivity recommendation disabled. Applicable for recommended sensitivity label only. Specifies whether the sensitivity recommendation on this column is disabled (dismissed) or not. - IsDisabled *bool `json:"isDisabled,omitempty"` +// Creates a new instance of the ServerVulnerabilityAssessmentListResultPage type. +func NewServerVulnerabilityAssessmentListResultPage(cur ServerVulnerabilityAssessmentListResult, getNextPage func(context.Context, ServerVulnerabilityAssessmentListResult) (ServerVulnerabilityAssessmentListResult, error)) ServerVulnerabilityAssessmentListResultPage { + return ServerVulnerabilityAssessmentListResultPage{ + fn: getNextPage, + svalr: cur, + } } -// MarshalJSON is the custom marshaler for SensitivityLabelProperties. -func (slp SensitivityLabelProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if slp.LabelName != nil { - objectMap["labelName"] = slp.LabelName - } - if slp.LabelID != nil { - objectMap["labelId"] = slp.LabelID - } - if slp.InformationType != nil { - objectMap["informationType"] = slp.InformationType - } - if slp.InformationTypeID != nil { - objectMap["informationTypeId"] = slp.InformationTypeID - } - return json.Marshal(objectMap) +// ServerVulnerabilityAssessmentProperties properties of a server Vulnerability Assessment. +type ServerVulnerabilityAssessmentProperties struct { + // StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). + StorageContainerPath *string `json:"storageContainerPath,omitempty"` + // StorageContainerSasKey - A shared access signature (SAS Key) that has read and write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. + StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"` + // StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. + StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + // RecurringScans - The recurring scans settings + RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"` } // SetObject ... @@ -6038,11 +9570,11 @@ type SQLPool struct { Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -6149,11 +9681,11 @@ type SQLPoolBlobAuditingPolicy struct { Kind *string `json:"kind,omitempty"` // SQLPoolBlobAuditingPolicyProperties - Resource properties. *SQLPoolBlobAuditingPolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -6226,6 +9758,166 @@ func (spbap *SQLPoolBlobAuditingPolicy) UnmarshalJSON(body []byte) error { return nil } +// SQLPoolBlobAuditingPolicyListResult a list of Sql pool auditing settings. +type SQLPoolBlobAuditingPolicyListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]SQLPoolBlobAuditingPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SQLPoolBlobAuditingPolicyListResultIterator provides access to a complete listing of +// SQLPoolBlobAuditingPolicy values. +type SQLPoolBlobAuditingPolicyListResultIterator struct { + i int + page SQLPoolBlobAuditingPolicyListResultPage +} + +// 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 *SQLPoolBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolBlobAuditingPolicyListResultIterator.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 *SQLPoolBlobAuditingPolicyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SQLPoolBlobAuditingPolicyListResultIterator) 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 SQLPoolBlobAuditingPolicyListResultIterator) Response() SQLPoolBlobAuditingPolicyListResult { + 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 SQLPoolBlobAuditingPolicyListResultIterator) Value() SQLPoolBlobAuditingPolicy { + if !iter.page.NotDone() { + return SQLPoolBlobAuditingPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SQLPoolBlobAuditingPolicyListResultIterator type. +func NewSQLPoolBlobAuditingPolicyListResultIterator(page SQLPoolBlobAuditingPolicyListResultPage) SQLPoolBlobAuditingPolicyListResultIterator { + return SQLPoolBlobAuditingPolicyListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (spbaplr SQLPoolBlobAuditingPolicyListResult) IsEmpty() bool { + return spbaplr.Value == nil || len(*spbaplr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (spbaplr SQLPoolBlobAuditingPolicyListResult) hasNextLink() bool { + return spbaplr.NextLink != nil && len(*spbaplr.NextLink) != 0 +} + +// sQLPoolBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (spbaplr SQLPoolBlobAuditingPolicyListResult) sQLPoolBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if !spbaplr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(spbaplr.NextLink))) +} + +// SQLPoolBlobAuditingPolicyListResultPage contains a page of SQLPoolBlobAuditingPolicy values. +type SQLPoolBlobAuditingPolicyListResultPage struct { + fn func(context.Context, SQLPoolBlobAuditingPolicyListResult) (SQLPoolBlobAuditingPolicyListResult, error) + spbaplr SQLPoolBlobAuditingPolicyListResult +} + +// 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 *SQLPoolBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolBlobAuditingPolicyListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.spbaplr) + if err != nil { + return err + } + page.spbaplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SQLPoolBlobAuditingPolicyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SQLPoolBlobAuditingPolicyListResultPage) NotDone() bool { + return !page.spbaplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SQLPoolBlobAuditingPolicyListResultPage) Response() SQLPoolBlobAuditingPolicyListResult { + return page.spbaplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SQLPoolBlobAuditingPolicyListResultPage) Values() []SQLPoolBlobAuditingPolicy { + if page.spbaplr.IsEmpty() { + return nil + } + return *page.spbaplr.Value +} + +// Creates a new instance of the SQLPoolBlobAuditingPolicyListResultPage type. +func NewSQLPoolBlobAuditingPolicyListResultPage(cur SQLPoolBlobAuditingPolicyListResult, getNextPage func(context.Context, SQLPoolBlobAuditingPolicyListResult) (SQLPoolBlobAuditingPolicyListResult, error)) SQLPoolBlobAuditingPolicyListResultPage { + return SQLPoolBlobAuditingPolicyListResultPage{ + fn: getNextPage, + spbaplr: cur, + } +} + // SQLPoolBlobAuditingPolicyProperties properties of a Sql pool blob auditing policy. type SQLPoolBlobAuditingPolicyProperties struct { // State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled' @@ -6465,19 +10157,23 @@ func (page SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage) Values() []S } // Creates a new instance of the SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage type. -func NewSQLPoolBlobAuditingPolicySQLPoolOperationListResultPage(getNextPage func(context.Context, SQLPoolBlobAuditingPolicySQLPoolOperationListResult) (SQLPoolBlobAuditingPolicySQLPoolOperationListResult, error)) SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage { - return SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage{fn: getNextPage} +func NewSQLPoolBlobAuditingPolicySQLPoolOperationListResultPage(cur SQLPoolBlobAuditingPolicySQLPoolOperationListResult, getNextPage func(context.Context, SQLPoolBlobAuditingPolicySQLPoolOperationListResult) (SQLPoolBlobAuditingPolicySQLPoolOperationListResult, error)) SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage { + return SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage{ + fn: getNextPage, + spbapspolr: cur, + } } // SQLPoolColumn a Sql pool column resource. type SQLPoolColumn struct { + autorest.Response `json:"-"` // SQLPoolColumnProperties - Resource properties. *SQLPoolColumnProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -6693,8 +10389,11 @@ func (page SQLPoolColumnListResultPage) Values() []SQLPoolColumn { } // Creates a new instance of the SQLPoolColumnListResultPage type. -func NewSQLPoolColumnListResultPage(getNextPage func(context.Context, SQLPoolColumnListResult) (SQLPoolColumnListResult, error)) SQLPoolColumnListResultPage { - return SQLPoolColumnListResultPage{fn: getNextPage} +func NewSQLPoolColumnListResultPage(cur SQLPoolColumnListResult, getNextPage func(context.Context, SQLPoolColumnListResult) (SQLPoolColumnListResult, error)) SQLPoolColumnListResultPage { + return SQLPoolColumnListResultPage{ + fn: getNextPage, + spclr: cur, + } } // SQLPoolColumnProperties sql pool column properties. @@ -6712,11 +10411,11 @@ type SQLPoolConnectionPolicy struct { Location *string `json:"location,omitempty"` // SQLPoolConnectionPolicyProperties - Resource properties. *SQLPoolConnectionPolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -6968,19 +10667,22 @@ func (page SQLPoolInfoListResultPage) Values() []SQLPool { } // Creates a new instance of the SQLPoolInfoListResultPage type. -func NewSQLPoolInfoListResultPage(getNextPage func(context.Context, SQLPoolInfoListResult) (SQLPoolInfoListResult, error)) SQLPoolInfoListResultPage { - return SQLPoolInfoListResultPage{fn: getNextPage} +func NewSQLPoolInfoListResultPage(cur SQLPoolInfoListResult, getNextPage func(context.Context, SQLPoolInfoListResult) (SQLPoolInfoListResult, error)) SQLPoolInfoListResultPage { + return SQLPoolInfoListResultPage{ + fn: getNextPage, + spilr: cur, + } } // SQLPoolOperation a Sql pool operation. type SQLPoolOperation struct { // SQLPoolOperationProperties - Resource properties. *SQLPoolOperationProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -7179,8 +10881,8 @@ type SQLPoolResourceProperties struct { CreationDate *date.Time `json:"creationDate,omitempty"` } -// SQLPoolRestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// SQLPoolRestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type SQLPoolRestorePointsCreateFuture struct { azure.Future } @@ -7210,11 +10912,12 @@ func (future *SQLPoolRestorePointsCreateFuture) Result(client SQLPoolRestorePoin // SQLPoolSchema a Sql pool schema resource. type SQLPoolSchema struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + autorest.Response `json:"-"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -7370,11 +11073,15 @@ func (page SQLPoolSchemaListResultPage) Values() []SQLPoolSchema { } // Creates a new instance of the SQLPoolSchemaListResultPage type. -func NewSQLPoolSchemaListResultPage(getNextPage func(context.Context, SQLPoolSchemaListResult) (SQLPoolSchemaListResult, error)) SQLPoolSchemaListResultPage { - return SQLPoolSchemaListResultPage{fn: getNextPage} +func NewSQLPoolSchemaListResultPage(cur SQLPoolSchemaListResult, getNextPage func(context.Context, SQLPoolSchemaListResult) (SQLPoolSchemaListResult, error)) SQLPoolSchemaListResultPage { + return SQLPoolSchemaListResultPage{ + fn: getNextPage, + spslr: cur, + } } -// SQLPoolsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// SQLPoolsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type SQLPoolsCreateFuture struct { azure.Future } @@ -7402,7 +11109,8 @@ func (future *SQLPoolsCreateFuture) Result(client SQLPoolsClient) (sp SQLPool, e return } -// SQLPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// SQLPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type SQLPoolsDeleteFuture struct { azure.Future } @@ -7435,11 +11143,11 @@ type SQLPoolSecurityAlertPolicy struct { autorest.Response `json:"-"` // SecurityAlertPolicyProperties - Resource properties. *SecurityAlertPolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -7503,7 +11211,8 @@ func (spsap *SQLPoolSecurityAlertPolicy) UnmarshalJSON(body []byte) error { return nil } -// SQLPoolsPauseFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// SQLPoolsPauseFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type SQLPoolsPauseFuture struct { azure.Future } @@ -7531,7 +11240,8 @@ func (future *SQLPoolsPauseFuture) Result(client SQLPoolsClient) (so SetObject, return } -// SQLPoolsResumeFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// SQLPoolsResumeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type SQLPoolsResumeFuture struct { azure.Future } @@ -7561,11 +11271,12 @@ func (future *SQLPoolsResumeFuture) Result(client SQLPoolsClient) (so SetObject, // SQLPoolTable a Sql pool table resource. type SQLPoolTable struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + autorest.Response `json:"-"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -7721,8 +11432,11 @@ func (page SQLPoolTableListResultPage) Values() []SQLPoolTable { } // Creates a new instance of the SQLPoolTableListResultPage type. -func NewSQLPoolTableListResultPage(getNextPage func(context.Context, SQLPoolTableListResult) (SQLPoolTableListResult, error)) SQLPoolTableListResultPage { - return SQLPoolTableListResultPage{fn: getNextPage} +func NewSQLPoolTableListResultPage(cur SQLPoolTableListResult, getNextPage func(context.Context, SQLPoolTableListResult) (SQLPoolTableListResult, error)) SQLPoolTableListResultPage { + return SQLPoolTableListResultPage{ + fn: getNextPage, + sptlr: cur, + } } // SQLPoolUsage the Sql pool usages. @@ -7904,8 +11618,11 @@ func (page SQLPoolUsageListResultPage) Values() []SQLPoolUsage { } // Creates a new instance of the SQLPoolUsageListResultPage type. -func NewSQLPoolUsageListResultPage(getNextPage func(context.Context, SQLPoolUsageListResult) (SQLPoolUsageListResult, error)) SQLPoolUsageListResultPage { - return SQLPoolUsageListResultPage{fn: getNextPage} +func NewSQLPoolUsageListResultPage(cur SQLPoolUsageListResult, getNextPage func(context.Context, SQLPoolUsageListResult) (SQLPoolUsageListResult, error)) SQLPoolUsageListResultPage { + return SQLPoolUsageListResultPage{ + fn: getNextPage, + spulr: cur, + } } // SQLPoolVulnerabilityAssessment a Sql pool vulnerability assessment. @@ -7913,11 +11630,11 @@ type SQLPoolVulnerabilityAssessment struct { autorest.Response `json:"-"` // SQLPoolVulnerabilityAssessmentProperties - Resource properties. *SQLPoolVulnerabilityAssessmentProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -8134,8 +11851,11 @@ func (page SQLPoolVulnerabilityAssessmentListResultPage) Values() []SQLPoolVulne } // Creates a new instance of the SQLPoolVulnerabilityAssessmentListResultPage type. -func NewSQLPoolVulnerabilityAssessmentListResultPage(getNextPage func(context.Context, SQLPoolVulnerabilityAssessmentListResult) (SQLPoolVulnerabilityAssessmentListResult, error)) SQLPoolVulnerabilityAssessmentListResultPage { - return SQLPoolVulnerabilityAssessmentListResultPage{fn: getNextPage} +func NewSQLPoolVulnerabilityAssessmentListResultPage(cur SQLPoolVulnerabilityAssessmentListResult, getNextPage func(context.Context, SQLPoolVulnerabilityAssessmentListResult) (SQLPoolVulnerabilityAssessmentListResult, error)) SQLPoolVulnerabilityAssessmentListResultPage { + return SQLPoolVulnerabilityAssessmentListResultPage{ + fn: getNextPage, + spvalr: cur, + } } // SQLPoolVulnerabilityAssessmentProperties properties of a Sql pool Vulnerability Assessment. @@ -8155,11 +11875,11 @@ type SQLPoolVulnerabilityAssessmentRuleBaseline struct { autorest.Response `json:"-"` // SQLPoolVulnerabilityAssessmentRuleBaselineProperties - Resource properties. *SQLPoolVulnerabilityAssessmentRuleBaselineProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -8230,8 +11950,8 @@ type SQLPoolVulnerabilityAssessmentRuleBaselineItem struct { Result *[]string `json:"result,omitempty"` } -// SQLPoolVulnerabilityAssessmentRuleBaselineProperties properties of a Sql pool vulnerability assessment rule -// baseline. +// SQLPoolVulnerabilityAssessmentRuleBaselineProperties properties of a Sql pool vulnerability assessment +// rule baseline. type SQLPoolVulnerabilityAssessmentRuleBaselineProperties struct { // BaselineResults - The rule baseline result BaselineResults *[]SQLPoolVulnerabilityAssessmentRuleBaselineItem `json:"baselineResults,omitempty"` @@ -8248,11 +11968,11 @@ type SQLPoolVulnerabilityAssessmentScansExport struct { autorest.Response `json:"-"` // SQLPoolVulnerabilityAssessmentScanExportProperties - Resource properties. *SQLPoolVulnerabilityAssessmentScanExportProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -8328,11 +12048,115 @@ func (future *SQLPoolVulnerabilityAssessmentScansInitiateScanFuture) Result(clie var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "synapse.SQLPoolVulnerabilityAssessmentScansInitiateScanFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "synapse.SQLPoolVulnerabilityAssessmentScansInitiateScanFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolVulnerabilityAssessmentScansInitiateScanFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLPoolWorkloadClassifierCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type SQLPoolWorkloadClassifierCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SQLPoolWorkloadClassifierCreateOrUpdateFuture) Result(client SQLPoolWorkloadClassifierClient) (wc WorkloadClassifier, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolWorkloadClassifierCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if wc.Response.Response, err = future.GetResult(sender); err == nil && wc.Response.Response.StatusCode != http.StatusNoContent { + wc, err = client.CreateOrUpdateResponder(wc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierCreateOrUpdateFuture", "Result", wc.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLPoolWorkloadClassifierDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLPoolWorkloadClassifierDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SQLPoolWorkloadClassifierDeleteFuture) Result(client SQLPoolWorkloadClassifierClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolWorkloadClassifierDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLPoolWorkloadGroupCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLPoolWorkloadGroupCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SQLPoolWorkloadGroupCreateOrUpdateFuture) Result(client SQLPoolWorkloadGroupClient) (wg WorkloadGroup, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolWorkloadGroupCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if wg.Response.Response, err = future.GetResult(sender); err == nil && wg.Response.Response.StatusCode != http.StatusNoContent { + wg, err = client.CreateOrUpdateResponder(wg.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupCreateOrUpdateFuture", "Result", wg.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLPoolWorkloadGroupDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLPoolWorkloadGroupDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SQLPoolWorkloadGroupDeleteFuture) Result(client SQLPoolWorkloadGroupClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolVulnerabilityAssessmentScansInitiateScanFuture") + err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolWorkloadGroupDeleteFuture") return } ar.Response = future.Response() @@ -8453,47 +12277,328 @@ func (sf SsisFolder) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsSsisFolder is the BasicSsisObjectMetadata implementation for SsisFolder. -func (sf SsisFolder) AsSsisFolder() (*SsisFolder, bool) { - return &sf, true +// AsSsisFolder is the BasicSsisObjectMetadata implementation for SsisFolder. +func (sf SsisFolder) AsSsisFolder() (*SsisFolder, bool) { + return &sf, true +} + +// AsSsisProject is the BasicSsisObjectMetadata implementation for SsisFolder. +func (sf SsisFolder) AsSsisProject() (*SsisProject, bool) { + return nil, false +} + +// AsSsisPackage is the BasicSsisObjectMetadata implementation for SsisFolder. +func (sf SsisFolder) AsSsisPackage() (*SsisPackage, bool) { + return nil, false +} + +// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisFolder. +func (sf SsisFolder) AsSsisEnvironment() (*SsisEnvironment, bool) { + return nil, false +} + +// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisFolder. +func (sf SsisFolder) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) { + return nil, false +} + +// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisFolder. +func (sf SsisFolder) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) { + return &sf, true +} + +// BasicSsisObjectMetadata SSIS object metadata. +type BasicSsisObjectMetadata interface { + AsSsisFolder() (*SsisFolder, bool) + AsSsisProject() (*SsisProject, bool) + AsSsisPackage() (*SsisPackage, bool) + AsSsisEnvironment() (*SsisEnvironment, bool) + AsSsisObjectMetadata() (*SsisObjectMetadata, bool) +} + +// SsisObjectMetadata SSIS object metadata. +type SsisObjectMetadata struct { + // ID - Metadata id. + ID *int64 `json:"id,omitempty"` + // Name - Metadata name. + Name *string `json:"name,omitempty"` + // Description - Metadata description. + Description *string `json:"description,omitempty"` + // Type - Possible values include: 'TypeSsisObjectMetadata', 'TypeFolder', 'TypeProject', 'TypePackage', 'TypeEnvironment' + Type TypeBasicSsisObjectMetadata `json:"type,omitempty"` +} + +func unmarshalBasicSsisObjectMetadata(body []byte) (BasicSsisObjectMetadata, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeFolder): + var sf SsisFolder + err := json.Unmarshal(body, &sf) + return sf, err + case string(TypeProject): + var sp SsisProject + err := json.Unmarshal(body, &sp) + return sp, err + case string(TypePackage): + var sp SsisPackage + err := json.Unmarshal(body, &sp) + return sp, err + case string(TypeEnvironment): + var se SsisEnvironment + err := json.Unmarshal(body, &se) + return se, err + default: + var som SsisObjectMetadata + err := json.Unmarshal(body, &som) + return som, err + } +} +func unmarshalBasicSsisObjectMetadataArray(body []byte) ([]BasicSsisObjectMetadata, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + somArray := make([]BasicSsisObjectMetadata, len(rawMessages)) + + for index, rawMessage := range rawMessages { + som, err := unmarshalBasicSsisObjectMetadata(*rawMessage) + if err != nil { + return nil, err + } + somArray[index] = som + } + return somArray, nil +} + +// MarshalJSON is the custom marshaler for SsisObjectMetadata. +func (som SsisObjectMetadata) MarshalJSON() ([]byte, error) { + som.Type = TypeSsisObjectMetadata + objectMap := make(map[string]interface{}) + if som.ID != nil { + objectMap["id"] = som.ID + } + if som.Name != nil { + objectMap["name"] = som.Name + } + if som.Description != nil { + objectMap["description"] = som.Description + } + if som.Type != "" { + objectMap["type"] = som.Type + } + return json.Marshal(objectMap) +} + +// AsSsisFolder is the BasicSsisObjectMetadata implementation for SsisObjectMetadata. +func (som SsisObjectMetadata) AsSsisFolder() (*SsisFolder, bool) { + return nil, false +} + +// AsSsisProject is the BasicSsisObjectMetadata implementation for SsisObjectMetadata. +func (som SsisObjectMetadata) AsSsisProject() (*SsisProject, bool) { + return nil, false +} + +// AsSsisPackage is the BasicSsisObjectMetadata implementation for SsisObjectMetadata. +func (som SsisObjectMetadata) AsSsisPackage() (*SsisPackage, bool) { + return nil, false +} + +// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisObjectMetadata. +func (som SsisObjectMetadata) AsSsisEnvironment() (*SsisEnvironment, bool) { + return nil, false +} + +// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisObjectMetadata. +func (som SsisObjectMetadata) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) { + return &som, true +} + +// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisObjectMetadata. +func (som SsisObjectMetadata) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) { + return &som, true +} + +// SsisObjectMetadataListResponse a list of SSIS object metadata. +type SsisObjectMetadataListResponse struct { + autorest.Response `json:"-"` + // Value - List of SSIS object metadata. + Value *[]BasicSsisObjectMetadata `json:"value,omitempty"` + // NextLink - The link to the next page of results, if any remaining results exist. + NextLink *string `json:"nextLink,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SsisObjectMetadataListResponse struct. +func (somlr *SsisObjectMetadataListResponse) 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 "value": + if v != nil { + value, err := unmarshalBasicSsisObjectMetadataArray(*v) + if err != nil { + return err + } + somlr.Value = &value + } + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + somlr.NextLink = &nextLink + } + } + } + + return nil +} + +// SsisObjectMetadataStatusResponse the status of the operation. +type SsisObjectMetadataStatusResponse struct { + autorest.Response `json:"-"` + // Status - The status of the operation. + Status *string `json:"status,omitempty"` + // Name - The operation name. + Name *string `json:"name,omitempty"` + // Properties - The operation properties. + Properties *string `json:"properties,omitempty"` + // Error - The operation error message. + Error *string `json:"error,omitempty"` +} + +// SsisPackage ssis Package. +type SsisPackage struct { + // FolderID - Folder id which contains package. + FolderID *int64 `json:"folderId,omitempty"` + // ProjectVersion - Project version which contains package. + ProjectVersion *int64 `json:"projectVersion,omitempty"` + // ProjectID - Project id which contains package. + ProjectID *int64 `json:"projectId,omitempty"` + // Parameters - Parameters in package + Parameters *[]SsisParameter `json:"parameters,omitempty"` + // ID - Metadata id. + ID *int64 `json:"id,omitempty"` + // Name - Metadata name. + Name *string `json:"name,omitempty"` + // Description - Metadata description. + Description *string `json:"description,omitempty"` + // Type - Possible values include: 'TypeSsisObjectMetadata', 'TypeFolder', 'TypeProject', 'TypePackage', 'TypeEnvironment' + Type TypeBasicSsisObjectMetadata `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SsisPackage. +func (sp SsisPackage) MarshalJSON() ([]byte, error) { + sp.Type = TypePackage + objectMap := make(map[string]interface{}) + if sp.FolderID != nil { + objectMap["folderId"] = sp.FolderID + } + if sp.ProjectVersion != nil { + objectMap["projectVersion"] = sp.ProjectVersion + } + if sp.ProjectID != nil { + objectMap["projectId"] = sp.ProjectID + } + if sp.Parameters != nil { + objectMap["parameters"] = sp.Parameters + } + if sp.ID != nil { + objectMap["id"] = sp.ID + } + if sp.Name != nil { + objectMap["name"] = sp.Name + } + if sp.Description != nil { + objectMap["description"] = sp.Description + } + if sp.Type != "" { + objectMap["type"] = sp.Type + } + return json.Marshal(objectMap) +} + +// AsSsisFolder is the BasicSsisObjectMetadata implementation for SsisPackage. +func (sp SsisPackage) AsSsisFolder() (*SsisFolder, bool) { + return nil, false } -// AsSsisProject is the BasicSsisObjectMetadata implementation for SsisFolder. -func (sf SsisFolder) AsSsisProject() (*SsisProject, bool) { +// AsSsisProject is the BasicSsisObjectMetadata implementation for SsisPackage. +func (sp SsisPackage) AsSsisProject() (*SsisProject, bool) { return nil, false } -// AsSsisPackage is the BasicSsisObjectMetadata implementation for SsisFolder. -func (sf SsisFolder) AsSsisPackage() (*SsisPackage, bool) { - return nil, false +// AsSsisPackage is the BasicSsisObjectMetadata implementation for SsisPackage. +func (sp SsisPackage) AsSsisPackage() (*SsisPackage, bool) { + return &sp, true } -// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisFolder. -func (sf SsisFolder) AsSsisEnvironment() (*SsisEnvironment, bool) { +// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisPackage. +func (sp SsisPackage) AsSsisEnvironment() (*SsisEnvironment, bool) { return nil, false } -// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisFolder. -func (sf SsisFolder) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) { +// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisPackage. +func (sp SsisPackage) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) { return nil, false } -// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisFolder. -func (sf SsisFolder) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) { - return &sf, true +// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisPackage. +func (sp SsisPackage) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) { + return &sp, true } -// BasicSsisObjectMetadata SSIS object metadata. -type BasicSsisObjectMetadata interface { - AsSsisFolder() (*SsisFolder, bool) - AsSsisProject() (*SsisProject, bool) - AsSsisPackage() (*SsisPackage, bool) - AsSsisEnvironment() (*SsisEnvironment, bool) - AsSsisObjectMetadata() (*SsisObjectMetadata, bool) +// SsisParameter ssis parameter. +type SsisParameter struct { + // ID - Parameter id. + ID *int64 `json:"id,omitempty"` + // Name - Parameter name. + Name *string `json:"name,omitempty"` + // Description - Parameter description. + Description *string `json:"description,omitempty"` + // DataType - Parameter type. + DataType *string `json:"dataType,omitempty"` + // Required - Whether parameter is required. + Required *bool `json:"required,omitempty"` + // Sensitive - Whether parameter is sensitive. + Sensitive *bool `json:"sensitive,omitempty"` + // DesignDefaultValue - Design default value of parameter. + DesignDefaultValue *string `json:"designDefaultValue,omitempty"` + // DefaultValue - Default value of parameter. + DefaultValue *string `json:"defaultValue,omitempty"` + // SensitiveDefaultValue - Default sensitive value of parameter. + SensitiveDefaultValue *string `json:"sensitiveDefaultValue,omitempty"` + // ValueType - Parameter value type. + ValueType *string `json:"valueType,omitempty"` + // ValueSet - Parameter value set. + ValueSet *bool `json:"valueSet,omitempty"` + // Variable - Parameter reference variable. + Variable *string `json:"variable,omitempty"` } -// SsisObjectMetadata SSIS object metadata. -type SsisObjectMetadata struct { +// SsisProject ssis project. +type SsisProject struct { + // FolderID - Folder id which contains project. + FolderID *int64 `json:"folderId,omitempty"` + // Version - Project version. + Version *int64 `json:"version,omitempty"` + // EnvironmentRefs - Environment reference in project + EnvironmentRefs *[]SsisEnvironmentReference `json:"environmentRefs,omitempty"` + // Parameters - Parameters in project + Parameters *[]SsisParameter `json:"parameters,omitempty"` // ID - Metadata id. ID *int64 `json:"id,omitempty"` // Name - Metadata name. @@ -8504,115 +12609,176 @@ type SsisObjectMetadata struct { Type TypeBasicSsisObjectMetadata `json:"type,omitempty"` } -func unmarshalBasicSsisObjectMetadata(body []byte) (BasicSsisObjectMetadata, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err +// MarshalJSON is the custom marshaler for SsisProject. +func (sp SsisProject) MarshalJSON() ([]byte, error) { + sp.Type = TypeProject + objectMap := make(map[string]interface{}) + if sp.FolderID != nil { + objectMap["folderId"] = sp.FolderID } - - switch m["type"] { - case string(TypeFolder): - var sf SsisFolder - err := json.Unmarshal(body, &sf) - return sf, err - case string(TypeProject): - var sp SsisProject - err := json.Unmarshal(body, &sp) - return sp, err - case string(TypePackage): - var sp SsisPackage - err := json.Unmarshal(body, &sp) - return sp, err - case string(TypeEnvironment): - var se SsisEnvironment - err := json.Unmarshal(body, &se) - return se, err - default: - var som SsisObjectMetadata - err := json.Unmarshal(body, &som) - return som, err + if sp.Version != nil { + objectMap["version"] = sp.Version } -} -func unmarshalBasicSsisObjectMetadataArray(body []byte) ([]BasicSsisObjectMetadata, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + if sp.EnvironmentRefs != nil { + objectMap["environmentRefs"] = sp.EnvironmentRefs } - - somArray := make([]BasicSsisObjectMetadata, len(rawMessages)) - - for index, rawMessage := range rawMessages { - som, err := unmarshalBasicSsisObjectMetadata(*rawMessage) - if err != nil { - return nil, err - } - somArray[index] = som + if sp.Parameters != nil { + objectMap["parameters"] = sp.Parameters } - return somArray, nil -} - -// MarshalJSON is the custom marshaler for SsisObjectMetadata. -func (som SsisObjectMetadata) MarshalJSON() ([]byte, error) { - som.Type = TypeSsisObjectMetadata - objectMap := make(map[string]interface{}) - if som.ID != nil { - objectMap["id"] = som.ID + if sp.ID != nil { + objectMap["id"] = sp.ID } - if som.Name != nil { - objectMap["name"] = som.Name + if sp.Name != nil { + objectMap["name"] = sp.Name } - if som.Description != nil { - objectMap["description"] = som.Description + if sp.Description != nil { + objectMap["description"] = sp.Description } - if som.Type != "" { - objectMap["type"] = som.Type + if sp.Type != "" { + objectMap["type"] = sp.Type } return json.Marshal(objectMap) } -// AsSsisFolder is the BasicSsisObjectMetadata implementation for SsisObjectMetadata. -func (som SsisObjectMetadata) AsSsisFolder() (*SsisFolder, bool) { +// AsSsisFolder is the BasicSsisObjectMetadata implementation for SsisProject. +func (sp SsisProject) AsSsisFolder() (*SsisFolder, bool) { return nil, false } -// AsSsisProject is the BasicSsisObjectMetadata implementation for SsisObjectMetadata. -func (som SsisObjectMetadata) AsSsisProject() (*SsisProject, bool) { +// AsSsisProject is the BasicSsisObjectMetadata implementation for SsisProject. +func (sp SsisProject) AsSsisProject() (*SsisProject, bool) { + return &sp, true +} + +// AsSsisPackage is the BasicSsisObjectMetadata implementation for SsisProject. +func (sp SsisProject) AsSsisPackage() (*SsisPackage, bool) { return nil, false } -// AsSsisPackage is the BasicSsisObjectMetadata implementation for SsisObjectMetadata. -func (som SsisObjectMetadata) AsSsisPackage() (*SsisPackage, bool) { +// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisProject. +func (sp SsisProject) AsSsisEnvironment() (*SsisEnvironment, bool) { return nil, false } -// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisObjectMetadata. -func (som SsisObjectMetadata) AsSsisEnvironment() (*SsisEnvironment, bool) { +// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisProject. +func (sp SsisProject) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) { return nil, false } -// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisObjectMetadata. -func (som SsisObjectMetadata) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) { - return &som, true +// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisProject. +func (sp SsisProject) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) { + return &sp, true } -// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisObjectMetadata. -func (som SsisObjectMetadata) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) { - return &som, true +// SsisVariable ssis variable. +type SsisVariable struct { + // ID - Variable id. + ID *int64 `json:"id,omitempty"` + // Name - Variable name. + Name *string `json:"name,omitempty"` + // Description - Variable description. + Description *string `json:"description,omitempty"` + // DataType - Variable type. + DataType *string `json:"dataType,omitempty"` + // Sensitive - Whether variable is sensitive. + Sensitive *bool `json:"sensitive,omitempty"` + // Value - Variable value. + Value *string `json:"value,omitempty"` + // SensitiveValue - Variable sensitive value. + SensitiveValue *string `json:"sensitiveValue,omitempty"` +} + +// SubResource azure Synapse nested resource, which belongs to a workspace. +type SubResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// TopQueries a database query. +type TopQueries struct { + // AggregationFunction - READ-ONLY; The function that is used to aggregate each query's metrics. Possible values include: 'Min', 'Max', 'Avg', 'Sum' + AggregationFunction QueryAggregationFunction `json:"aggregationFunction,omitempty"` + // ExecutionType - READ-ONLY; The execution type that is used to filter the query instances that are returned. Possible values include: 'Any', 'Regular', 'Irregular', 'Aborted', 'Exception' + ExecutionType QueryExecutionType `json:"executionType,omitempty"` + // IntervalType - READ-ONLY; The duration of the interval (ISO8601 duration format). + IntervalType *string `json:"intervalType,omitempty"` + // NumberOfTopQueries - READ-ONLY; The number of requested queries. + NumberOfTopQueries *float64 `json:"numberOfTopQueries,omitempty"` + // ObservationStartTime - READ-ONLY; The start time for queries that are returned (ISO8601 format) + ObservationStartTime *date.Time `json:"observationStartTime,omitempty"` + // ObservationEndTime - READ-ONLY; The end time for queries that are returned (ISO8601 format) + ObservationEndTime *date.Time `json:"observationEndTime,omitempty"` + // ObservedMetric - READ-ONLY; The type of metric to use for ordering the top metrics. Possible values include: 'CPU', 'Io', 'Logio', 'Duration', 'ExecutionCount' + ObservedMetric QueryObservedMetricType `json:"observedMetric,omitempty"` + // Queries - READ-ONLY; The list of queries. + Queries *[]QueryStatistic `json:"queries,omitempty"` +} + +// TopQueriesListResult represents the response to a get top queries request. +type TopQueriesListResult struct { + // Value - The list of top queries. + Value *[]TopQueries `json:"value,omitempty"` +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) } -// SsisObjectMetadataListResponse a list of SSIS object metadata. -type SsisObjectMetadataListResponse struct { +// TransparentDataEncryption represents a Sql pool transparent data encryption configuration. +type TransparentDataEncryption struct { autorest.Response `json:"-"` - // Value - List of SSIS object metadata. - Value *[]BasicSsisObjectMetadata `json:"value,omitempty"` - // NextLink - The link to the next page of results, if any remaining results exist. - NextLink *string `json:"nextLink,omitempty"` + // Location - READ-ONLY; Resource location. + Location *string `json:"location,omitempty"` + // TransparentDataEncryptionProperties - Represents the properties of the resource. + *TransparentDataEncryptionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for SsisObjectMetadataListResponse struct. -func (somlr *SsisObjectMetadataListResponse) UnmarshalJSON(body []byte) error { +// MarshalJSON is the custom marshaler for TransparentDataEncryption. +func (tde TransparentDataEncryption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tde.TransparentDataEncryptionProperties != nil { + objectMap["properties"] = tde.TransparentDataEncryptionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryption struct. +func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -8620,22 +12786,50 @@ func (somlr *SsisObjectMetadataListResponse) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "value": + case "location": if v != nil { - value, err := unmarshalBasicSsisObjectMetadataArray(*v) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - somlr.Value = &value + tde.Location = &location } - case "nextLink": + case "properties": if v != nil { - var nextLink string - err = json.Unmarshal(*v, &nextLink) + var transparentDataEncryptionProperties TransparentDataEncryptionProperties + err = json.Unmarshal(*v, &transparentDataEncryptionProperties) if err != nil { return err } - somlr.NextLink = &nextLink + tde.TransparentDataEncryptionProperties = &transparentDataEncryptionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tde.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tde.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tde.Type = &typeVar } } } @@ -8643,317 +12837,489 @@ func (somlr *SsisObjectMetadataListResponse) UnmarshalJSON(body []byte) error { return nil } -// SsisObjectMetadataStatusResponse the status of the operation. -type SsisObjectMetadataStatusResponse struct { +// TransparentDataEncryptionListResult a list of transparent data encryption configurations. +type TransparentDataEncryptionListResult struct { autorest.Response `json:"-"` - // Status - The status of the operation. - Status *string `json:"status,omitempty"` - // Name - The operation name. - Name *string `json:"name,omitempty"` - // Properties - The operation properties. - Properties *string `json:"properties,omitempty"` - // Error - The operation error message. - Error *string `json:"error,omitempty"` + // Value - READ-ONLY; Array of results. + Value *[]TransparentDataEncryption `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` } -// SsisPackage ssis Package. -type SsisPackage struct { - // FolderID - Folder id which contains package. - FolderID *int64 `json:"folderId,omitempty"` - // ProjectVersion - Project version which contains package. - ProjectVersion *int64 `json:"projectVersion,omitempty"` - // ProjectID - Project id which contains package. - ProjectID *int64 `json:"projectId,omitempty"` - // Parameters - Parameters in package - Parameters *[]SsisParameter `json:"parameters,omitempty"` - // ID - Metadata id. - ID *int64 `json:"id,omitempty"` - // Name - Metadata name. - Name *string `json:"name,omitempty"` - // Description - Metadata description. - Description *string `json:"description,omitempty"` - // Type - Possible values include: 'TypeSsisObjectMetadata', 'TypeFolder', 'TypeProject', 'TypePackage', 'TypeEnvironment' - Type TypeBasicSsisObjectMetadata `json:"type,omitempty"` +// TransparentDataEncryptionListResultIterator provides access to a complete listing of +// TransparentDataEncryption values. +type TransparentDataEncryptionListResultIterator struct { + i int + page TransparentDataEncryptionListResultPage } -// MarshalJSON is the custom marshaler for SsisPackage. -func (sp SsisPackage) MarshalJSON() ([]byte, error) { - sp.Type = TypePackage - objectMap := make(map[string]interface{}) - if sp.FolderID != nil { - objectMap["folderId"] = sp.FolderID +// 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 *TransparentDataEncryptionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TransparentDataEncryptionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if sp.ProjectVersion != nil { - objectMap["projectVersion"] = sp.ProjectVersion + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil } - if sp.ProjectID != nil { - objectMap["projectId"] = sp.ProjectID + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err } - if sp.Parameters != nil { - objectMap["parameters"] = sp.Parameters + 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 *TransparentDataEncryptionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TransparentDataEncryptionListResultIterator) 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 TransparentDataEncryptionListResultIterator) Response() TransparentDataEncryptionListResult { + 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 TransparentDataEncryptionListResultIterator) Value() TransparentDataEncryption { + if !iter.page.NotDone() { + return TransparentDataEncryption{} } - if sp.ID != nil { - objectMap["id"] = sp.ID + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TransparentDataEncryptionListResultIterator type. +func NewTransparentDataEncryptionListResultIterator(page TransparentDataEncryptionListResultPage) TransparentDataEncryptionListResultIterator { + return TransparentDataEncryptionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tdelr TransparentDataEncryptionListResult) IsEmpty() bool { + return tdelr.Value == nil || len(*tdelr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (tdelr TransparentDataEncryptionListResult) hasNextLink() bool { + return tdelr.NextLink != nil && len(*tdelr.NextLink) != 0 +} + +// transparentDataEncryptionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tdelr TransparentDataEncryptionListResult) transparentDataEncryptionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !tdelr.hasNextLink() { + return nil, nil } - if sp.Name != nil { - objectMap["name"] = sp.Name + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tdelr.NextLink))) +} + +// TransparentDataEncryptionListResultPage contains a page of TransparentDataEncryption values. +type TransparentDataEncryptionListResultPage struct { + fn func(context.Context, TransparentDataEncryptionListResult) (TransparentDataEncryptionListResult, error) + tdelr TransparentDataEncryptionListResult +} + +// 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 *TransparentDataEncryptionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TransparentDataEncryptionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if sp.Description != nil { - objectMap["description"] = sp.Description + for { + next, err := page.fn(ctx, page.tdelr) + if err != nil { + return err + } + page.tdelr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - if sp.Type != "" { - objectMap["type"] = sp.Type + 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 *TransparentDataEncryptionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TransparentDataEncryptionListResultPage) NotDone() bool { + return !page.tdelr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TransparentDataEncryptionListResultPage) Response() TransparentDataEncryptionListResult { + return page.tdelr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TransparentDataEncryptionListResultPage) Values() []TransparentDataEncryption { + if page.tdelr.IsEmpty() { + return nil } - return json.Marshal(objectMap) + return *page.tdelr.Value } -// AsSsisFolder is the BasicSsisObjectMetadata implementation for SsisPackage. -func (sp SsisPackage) AsSsisFolder() (*SsisFolder, bool) { - return nil, false +// Creates a new instance of the TransparentDataEncryptionListResultPage type. +func NewTransparentDataEncryptionListResultPage(cur TransparentDataEncryptionListResult, getNextPage func(context.Context, TransparentDataEncryptionListResult) (TransparentDataEncryptionListResult, error)) TransparentDataEncryptionListResultPage { + return TransparentDataEncryptionListResultPage{ + fn: getNextPage, + tdelr: cur, + } } -// AsSsisProject is the BasicSsisObjectMetadata implementation for SsisPackage. -func (sp SsisPackage) AsSsisProject() (*SsisProject, bool) { - return nil, false +// TransparentDataEncryptionProperties represents the properties of a database transparent data encryption. +type TransparentDataEncryptionProperties struct { + // Status - The status of the database transparent data encryption. Possible values include: 'TransparentDataEncryptionStatusEnabled', 'TransparentDataEncryptionStatusDisabled' + Status TransparentDataEncryptionStatus `json:"status,omitempty"` +} + +// UpdateIntegrationRuntimeNodeRequest update integration runtime node request. +type UpdateIntegrationRuntimeNodeRequest struct { + // ConcurrentJobsLimit - The number of concurrent jobs permitted to run on the integration runtime node. Values between 1 and maxConcurrentJobs(inclusive) are allowed. + ConcurrentJobsLimit *int32 `json:"concurrentJobsLimit,omitempty"` +} + +// UpdateIntegrationRuntimeRequest update integration runtime request. +type UpdateIntegrationRuntimeRequest struct { + // AutoUpdate - Enables or disables the auto-update feature of the self-hosted integration runtime. See https://go.microsoft.com/fwlink/?linkid=854189. Possible values include: 'On', 'Off' + AutoUpdate IntegrationRuntimeAutoUpdate `json:"autoUpdate,omitempty"` + // UpdateDelayOffset - The time offset (in hours) in the day, e.g., PT03H is 3 hours. The integration runtime auto update will happen on that time. + UpdateDelayOffset *string `json:"updateDelayOffset,omitempty"` +} + +// VirtualNetworkProfile virtual Network Profile +type VirtualNetworkProfile struct { + // ComputeSubnetID - Subnet ID used for computes in workspace + ComputeSubnetID *string `json:"computeSubnetId,omitempty"` +} + +// VulnerabilityAssessmentRecurringScansProperties properties of a Vulnerability Assessment recurring +// scans. +type VulnerabilityAssessmentRecurringScansProperties struct { + // IsEnabled - Recurring scans state. + IsEnabled *bool `json:"isEnabled,omitempty"` + // EmailSubscriptionAdmins - Specifies that the schedule scan notification will be is sent to the subscription administrators. + EmailSubscriptionAdmins *bool `json:"emailSubscriptionAdmins,omitempty"` + // Emails - Specifies an array of e-mail addresses to which the scan notification is sent. + Emails *[]string `json:"emails,omitempty"` } -// AsSsisPackage is the BasicSsisObjectMetadata implementation for SsisPackage. -func (sp SsisPackage) AsSsisPackage() (*SsisPackage, bool) { - return &sp, true +// VulnerabilityAssessmentScanError properties of a vulnerability assessment scan error. +type VulnerabilityAssessmentScanError struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` } -// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisPackage. -func (sp SsisPackage) AsSsisEnvironment() (*SsisEnvironment, bool) { - return nil, false +// VulnerabilityAssessmentScanRecord a vulnerability assessment scan record. +type VulnerabilityAssessmentScanRecord struct { + autorest.Response `json:"-"` + // VulnerabilityAssessmentScanRecordProperties - Resource properties. + *VulnerabilityAssessmentScanRecordProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` } -// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisPackage. -func (sp SsisPackage) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) { - return nil, false +// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecord. +func (vasr VulnerabilityAssessmentScanRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vasr.VulnerabilityAssessmentScanRecordProperties != nil { + objectMap["properties"] = vasr.VulnerabilityAssessmentScanRecordProperties + } + return json.Marshal(objectMap) } -// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisPackage. -func (sp SsisPackage) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) { - return &sp, true +// UnmarshalJSON is the custom unmarshaler for VulnerabilityAssessmentScanRecord struct. +func (vasr *VulnerabilityAssessmentScanRecord) 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 vulnerabilityAssessmentScanRecordProperties VulnerabilityAssessmentScanRecordProperties + err = json.Unmarshal(*v, &vulnerabilityAssessmentScanRecordProperties) + if err != nil { + return err + } + vasr.VulnerabilityAssessmentScanRecordProperties = &vulnerabilityAssessmentScanRecordProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vasr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vasr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vasr.Type = &typeVar + } + } + } + + return nil } -// SsisParameter ssis parameter. -type SsisParameter struct { - // ID - Parameter id. - ID *int64 `json:"id,omitempty"` - // Name - Parameter name. - Name *string `json:"name,omitempty"` - // Description - Parameter description. - Description *string `json:"description,omitempty"` - // DataType - Parameter type. - DataType *string `json:"dataType,omitempty"` - // Required - Whether parameter is required. - Required *bool `json:"required,omitempty"` - // Sensitive - Whether parameter is sensitive. - Sensitive *bool `json:"sensitive,omitempty"` - // DesignDefaultValue - Design default value of parameter. - DesignDefaultValue *string `json:"designDefaultValue,omitempty"` - // DefaultValue - Default value of parameter. - DefaultValue *string `json:"defaultValue,omitempty"` - // SensitiveDefaultValue - Default sensitive value of parameter. - SensitiveDefaultValue *string `json:"sensitiveDefaultValue,omitempty"` - // ValueType - Parameter value type. - ValueType *string `json:"valueType,omitempty"` - // ValueSet - Parameter value set. - ValueSet *bool `json:"valueSet,omitempty"` - // Variable - Parameter reference variable. - Variable *string `json:"variable,omitempty"` +// VulnerabilityAssessmentScanRecordListResult a list of vulnerability assessment scan records. +type VulnerabilityAssessmentScanRecordListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]VulnerabilityAssessmentScanRecord `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` } -// SsisProject ssis project. -type SsisProject struct { - // FolderID - Folder id which contains project. - FolderID *int64 `json:"folderId,omitempty"` - // Version - Project version. - Version *int64 `json:"version,omitempty"` - // EnvironmentRefs - Environment reference in project - EnvironmentRefs *[]SsisEnvironmentReference `json:"environmentRefs,omitempty"` - // Parameters - Parameters in project - Parameters *[]SsisParameter `json:"parameters,omitempty"` - // ID - Metadata id. - ID *int64 `json:"id,omitempty"` - // Name - Metadata name. - Name *string `json:"name,omitempty"` - // Description - Metadata description. - Description *string `json:"description,omitempty"` - // Type - Possible values include: 'TypeSsisObjectMetadata', 'TypeFolder', 'TypeProject', 'TypePackage', 'TypeEnvironment' - Type TypeBasicSsisObjectMetadata `json:"type,omitempty"` +// VulnerabilityAssessmentScanRecordListResultIterator provides access to a complete listing of +// VulnerabilityAssessmentScanRecord values. +type VulnerabilityAssessmentScanRecordListResultIterator struct { + i int + page VulnerabilityAssessmentScanRecordListResultPage } -// MarshalJSON is the custom marshaler for SsisProject. -func (sp SsisProject) MarshalJSON() ([]byte, error) { - sp.Type = TypeProject - objectMap := make(map[string]interface{}) - if sp.FolderID != nil { - objectMap["folderId"] = sp.FolderID - } - if sp.Version != nil { - objectMap["version"] = sp.Version - } - if sp.EnvironmentRefs != nil { - objectMap["environmentRefs"] = sp.EnvironmentRefs - } - if sp.Parameters != nil { - objectMap["parameters"] = sp.Parameters - } - if sp.ID != nil { - objectMap["id"] = sp.ID - } - if sp.Name != nil { - objectMap["name"] = sp.Name +// 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 *VulnerabilityAssessmentScanRecordListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if sp.Description != nil { - objectMap["description"] = sp.Description + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil } - if sp.Type != "" { - objectMap["type"] = sp.Type + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err } - return json.Marshal(objectMap) + iter.i = 0 + return nil } -// AsSsisFolder is the BasicSsisObjectMetadata implementation for SsisProject. -func (sp SsisProject) AsSsisFolder() (*SsisFolder, bool) { - return nil, false +// 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 *VulnerabilityAssessmentScanRecordListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// AsSsisProject is the BasicSsisObjectMetadata implementation for SsisProject. -func (sp SsisProject) AsSsisProject() (*SsisProject, bool) { - return &sp, true +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VulnerabilityAssessmentScanRecordListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// AsSsisPackage is the BasicSsisObjectMetadata implementation for SsisProject. -func (sp SsisProject) AsSsisPackage() (*SsisPackage, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (iter VulnerabilityAssessmentScanRecordListResultIterator) Response() VulnerabilityAssessmentScanRecordListResult { + return iter.page.Response() } -// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisProject. -func (sp SsisProject) AsSsisEnvironment() (*SsisEnvironment, bool) { - return nil, false +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VulnerabilityAssessmentScanRecordListResultIterator) Value() VulnerabilityAssessmentScanRecord { + if !iter.page.NotDone() { + return VulnerabilityAssessmentScanRecord{} + } + return iter.page.Values()[iter.i] } -// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisProject. -func (sp SsisProject) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) { - return nil, false +// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultIterator type. +func NewVulnerabilityAssessmentScanRecordListResultIterator(page VulnerabilityAssessmentScanRecordListResultPage) VulnerabilityAssessmentScanRecordListResultIterator { + return VulnerabilityAssessmentScanRecordListResultIterator{page: page} } -// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisProject. -func (sp SsisProject) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) { - return &sp, true +// IsEmpty returns true if the ListResult contains no values. +func (vasrlr VulnerabilityAssessmentScanRecordListResult) IsEmpty() bool { + return vasrlr.Value == nil || len(*vasrlr.Value) == 0 } -// SsisVariable ssis variable. -type SsisVariable struct { - // ID - Variable id. - ID *int64 `json:"id,omitempty"` - // Name - Variable name. - Name *string `json:"name,omitempty"` - // Description - Variable description. - Description *string `json:"description,omitempty"` - // DataType - Variable type. - DataType *string `json:"dataType,omitempty"` - // Sensitive - Whether variable is sensitive. - Sensitive *bool `json:"sensitive,omitempty"` - // Value - Variable value. - Value *string `json:"value,omitempty"` - // SensitiveValue - Variable sensitive value. - SensitiveValue *string `json:"sensitiveValue,omitempty"` +// hasNextLink returns true if the NextLink is not empty. +func (vasrlr VulnerabilityAssessmentScanRecordListResult) hasNextLink() bool { + return vasrlr.NextLink != nil && len(*vasrlr.NextLink) != 0 +} + +// vulnerabilityAssessmentScanRecordListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vasrlr VulnerabilityAssessmentScanRecordListResult) vulnerabilityAssessmentScanRecordListResultPreparer(ctx context.Context) (*http.Request, error) { + if !vasrlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vasrlr.NextLink))) } -// SubResource azure Synapse nested resource, which belongs to a workspace. -type SubResource struct { - // Etag - READ-ONLY; Resource Etag. - Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` +// VulnerabilityAssessmentScanRecordListResultPage contains a page of VulnerabilityAssessmentScanRecord +// values. +type VulnerabilityAssessmentScanRecordListResultPage struct { + fn func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error) + vasrlr VulnerabilityAssessmentScanRecordListResult } -// TopQueries a database query. -type TopQueries struct { - // AggregationFunction - READ-ONLY; The function that is used to aggregate each query's metrics. Possible values include: 'Min', 'Max', 'Avg', 'Sum' - AggregationFunction QueryAggregationFunction `json:"aggregationFunction,omitempty"` - // ExecutionType - READ-ONLY; The execution type that is used to filter the query instances that are returned. Possible values include: 'Any', 'Regular', 'Irregular', 'Aborted', 'Exception' - ExecutionType QueryExecutionType `json:"executionType,omitempty"` - // IntervalType - READ-ONLY; The duration of the interval (ISO8601 duration format). - IntervalType *string `json:"intervalType,omitempty"` - // NumberOfTopQueries - READ-ONLY; The number of requested queries. - NumberOfTopQueries *float64 `json:"numberOfTopQueries,omitempty"` - // ObservationStartTime - READ-ONLY; The start time for queries that are returned (ISO8601 format) - ObservationStartTime *date.Time `json:"observationStartTime,omitempty"` - // ObservationEndTime - READ-ONLY; The end time for queries that are returned (ISO8601 format) - ObservationEndTime *date.Time `json:"observationEndTime,omitempty"` - // ObservedMetric - READ-ONLY; The type of metric to use for ordering the top metrics. Possible values include: 'CPU', 'Io', 'Logio', 'Duration', 'ExecutionCount' - ObservedMetric QueryObservedMetricType `json:"observedMetric,omitempty"` - // Queries - READ-ONLY; The list of queries. - Queries *[]QueryStatistic `json:"queries,omitempty"` +// 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 *VulnerabilityAssessmentScanRecordListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vasrlr) + if err != nil { + return err + } + page.vasrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil } -// TopQueriesListResult represents the response to a get top queries request. -type TopQueriesListResult struct { - // Value - The list of top queries. - Value *[]TopQueries `json:"value,omitempty"` +// 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 *VulnerabilityAssessmentScanRecordListResultPage) Next() error { + return page.NextWithContext(context.Background()) } -// TrackedResource the resource model definition for a ARM tracked top level resource -type TrackedResource struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VulnerabilityAssessmentScanRecordListResultPage) NotDone() bool { + return !page.vasrlr.IsEmpty() } -// MarshalJSON is the custom marshaler for TrackedResource. -func (tr TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tr.Tags != nil { - objectMap["tags"] = tr.Tags +// Response returns the raw server response from the last page request. +func (page VulnerabilityAssessmentScanRecordListResultPage) Response() VulnerabilityAssessmentScanRecordListResult { + return page.vasrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VulnerabilityAssessmentScanRecordListResultPage) Values() []VulnerabilityAssessmentScanRecord { + if page.vasrlr.IsEmpty() { + return nil } - if tr.Location != nil { - objectMap["location"] = tr.Location + return *page.vasrlr.Value +} + +// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultPage type. +func NewVulnerabilityAssessmentScanRecordListResultPage(cur VulnerabilityAssessmentScanRecordListResult, getNextPage func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error)) VulnerabilityAssessmentScanRecordListResultPage { + return VulnerabilityAssessmentScanRecordListResultPage{ + fn: getNextPage, + vasrlr: cur, } - return json.Marshal(objectMap) } -// TransparentDataEncryption represents a Sql pool transparent data encryption configuration. -type TransparentDataEncryption struct { +// VulnerabilityAssessmentScanRecordProperties properties of a vulnerability assessment scan record. +type VulnerabilityAssessmentScanRecordProperties struct { + // ScanID - READ-ONLY; The scan ID. + ScanID *string `json:"scanId,omitempty"` + // TriggerType - READ-ONLY; The scan trigger type. Possible values include: 'OnDemand', 'Recurring' + TriggerType VulnerabilityAssessmentScanTriggerType `json:"triggerType,omitempty"` + // State - READ-ONLY; The scan status. Possible values include: 'VulnerabilityAssessmentScanStatePassed', 'VulnerabilityAssessmentScanStateFailed', 'VulnerabilityAssessmentScanStateFailedToRun', 'VulnerabilityAssessmentScanStateInProgress' + State VulnerabilityAssessmentScanState `json:"state,omitempty"` + // StartTime - READ-ONLY; The scan start time (UTC). + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The scan end time (UTC). + EndTime *date.Time `json:"endTime,omitempty"` + // Errors - READ-ONLY; The scan errors. + Errors *[]VulnerabilityAssessmentScanError `json:"errors,omitempty"` + // StorageContainerPath - READ-ONLY; The scan results storage container path. + StorageContainerPath *string `json:"storageContainerPath,omitempty"` + // NumberOfFailedSecurityChecks - READ-ONLY; The number of failed security checks. + NumberOfFailedSecurityChecks *int32 `json:"numberOfFailedSecurityChecks,omitempty"` +} + +// WorkloadClassifier workload classifier operations for a data warehouse +type WorkloadClassifier struct { autorest.Response `json:"-"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // TransparentDataEncryptionProperties - Represents the properties of the resource. - *TransparentDataEncryptionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // WorkloadClassifierProperties - Resource properties. + *WorkloadClassifierProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for TransparentDataEncryption. -func (tde TransparentDataEncryption) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for WorkloadClassifier. +func (wc WorkloadClassifier) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if tde.TransparentDataEncryptionProperties != nil { - objectMap["properties"] = tde.TransparentDataEncryptionProperties + if wc.WorkloadClassifierProperties != nil { + objectMap["properties"] = wc.WorkloadClassifierProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryption struct. -func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for WorkloadClassifier struct. +func (wc *WorkloadClassifier) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -8961,23 +13327,14 @@ func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - tde.Location = &location - } case "properties": if v != nil { - var transparentDataEncryptionProperties TransparentDataEncryptionProperties - err = json.Unmarshal(*v, &transparentDataEncryptionProperties) + var workloadClassifierProperties WorkloadClassifierProperties + err = json.Unmarshal(*v, &workloadClassifierProperties) if err != nil { return err } - tde.TransparentDataEncryptionProperties = &transparentDataEncryptionProperties + wc.WorkloadClassifierProperties = &workloadClassifierProperties } case "id": if v != nil { @@ -8986,7 +13343,7 @@ func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error { if err != nil { return err } - tde.ID = &ID + wc.ID = &ID } case "name": if v != nil { @@ -8995,7 +13352,7 @@ func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error { if err != nil { return err } - tde.Name = &name + wc.Name = &name } case "type": if v != nil { @@ -9004,7 +13361,7 @@ func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error { if err != nil { return err } - tde.Type = &typeVar + wc.Type = &typeVar } } } @@ -9012,73 +13369,206 @@ func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error { return nil } -// TransparentDataEncryptionProperties represents the properties of a database transparent data encryption. -type TransparentDataEncryptionProperties struct { - // Status - The status of the database transparent data encryption. Possible values include: 'TransparentDataEncryptionStatusEnabled', 'TransparentDataEncryptionStatusDisabled' - Status TransparentDataEncryptionStatus `json:"status,omitempty"` +// WorkloadClassifierListResult a list of workload classifiers for a workload group. +type WorkloadClassifierListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]WorkloadClassifier `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` } -// UpdateIntegrationRuntimeNodeRequest update integration runtime node request. -type UpdateIntegrationRuntimeNodeRequest struct { - // ConcurrentJobsLimit - The number of concurrent jobs permitted to run on the integration runtime node. Values between 1 and maxConcurrentJobs(inclusive) are allowed. - ConcurrentJobsLimit *int32 `json:"concurrentJobsLimit,omitempty"` +// WorkloadClassifierListResultIterator provides access to a complete listing of WorkloadClassifier values. +type WorkloadClassifierListResultIterator struct { + i int + page WorkloadClassifierListResultPage } -// UpdateIntegrationRuntimeRequest update integration runtime request. -type UpdateIntegrationRuntimeRequest struct { - // AutoUpdate - Enables or disables the auto-update feature of the self-hosted integration runtime. See https://go.microsoft.com/fwlink/?linkid=854189. Possible values include: 'On', 'Off' - AutoUpdate IntegrationRuntimeAutoUpdate `json:"autoUpdate,omitempty"` - // UpdateDelayOffset - The time offset (in hours) in the day, e.g., PT03H is 3 hours. The integration runtime auto update will happen on that time. - UpdateDelayOffset *string `json:"updateDelayOffset,omitempty"` +// 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 *WorkloadClassifierListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadClassifierListResultIterator.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 *WorkloadClassifierListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkloadClassifierListResultIterator) 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 WorkloadClassifierListResultIterator) Response() WorkloadClassifierListResult { + 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 WorkloadClassifierListResultIterator) Value() WorkloadClassifier { + if !iter.page.NotDone() { + return WorkloadClassifier{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkloadClassifierListResultIterator type. +func NewWorkloadClassifierListResultIterator(page WorkloadClassifierListResultPage) WorkloadClassifierListResultIterator { + return WorkloadClassifierListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wclr WorkloadClassifierListResult) IsEmpty() bool { + return wclr.Value == nil || len(*wclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (wclr WorkloadClassifierListResult) hasNextLink() bool { + return wclr.NextLink != nil && len(*wclr.NextLink) != 0 +} + +// workloadClassifierListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wclr WorkloadClassifierListResult) workloadClassifierListResultPreparer(ctx context.Context) (*http.Request, error) { + if !wclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wclr.NextLink))) +} + +// WorkloadClassifierListResultPage contains a page of WorkloadClassifier values. +type WorkloadClassifierListResultPage struct { + fn func(context.Context, WorkloadClassifierListResult) (WorkloadClassifierListResult, error) + wclr WorkloadClassifierListResult +} + +// 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 *WorkloadClassifierListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadClassifierListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.wclr) + if err != nil { + return err + } + page.wclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *WorkloadClassifierListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkloadClassifierListResultPage) NotDone() bool { + return !page.wclr.IsEmpty() } -// VirtualNetworkProfile virtual Network Profile -type VirtualNetworkProfile struct { - // ComputeSubnetID - Subnet ID used for computes in workspace - ComputeSubnetID *string `json:"computeSubnetId,omitempty"` +// Response returns the raw server response from the last page request. +func (page WorkloadClassifierListResultPage) Response() WorkloadClassifierListResult { + return page.wclr } -// VulnerabilityAssessmentRecurringScansProperties properties of a Vulnerability Assessment recurring scans. -type VulnerabilityAssessmentRecurringScansProperties struct { - // IsEnabled - Recurring scans state. - IsEnabled *bool `json:"isEnabled,omitempty"` - // EmailSubscriptionAdmins - Specifies that the schedule scan notification will be is sent to the subscription administrators. - EmailSubscriptionAdmins *bool `json:"emailSubscriptionAdmins,omitempty"` - // Emails - Specifies an array of e-mail addresses to which the scan notification is sent. - Emails *[]string `json:"emails,omitempty"` +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkloadClassifierListResultPage) Values() []WorkloadClassifier { + if page.wclr.IsEmpty() { + return nil + } + return *page.wclr.Value } -// VulnerabilityAssessmentScanError properties of a vulnerability assessment scan error. -type VulnerabilityAssessmentScanError struct { - // Code - READ-ONLY; The error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; The error message. - Message *string `json:"message,omitempty"` +// Creates a new instance of the WorkloadClassifierListResultPage type. +func NewWorkloadClassifierListResultPage(cur WorkloadClassifierListResult, getNextPage func(context.Context, WorkloadClassifierListResult) (WorkloadClassifierListResult, error)) WorkloadClassifierListResultPage { + return WorkloadClassifierListResultPage{ + fn: getNextPage, + wclr: cur, + } } -// VulnerabilityAssessmentScanRecord a vulnerability assessment scan record. -type VulnerabilityAssessmentScanRecord struct { - // VulnerabilityAssessmentScanRecordProperties - Resource properties. - *VulnerabilityAssessmentScanRecordProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} +// WorkloadClassifierProperties workload classifier definition. For more information look at +// sys.workload_management_workload_classifiers (DMV). +type WorkloadClassifierProperties struct { + // MemberName - The workload classifier member name. + MemberName *string `json:"memberName,omitempty"` + // Label - The workload classifier label. + Label *string `json:"label,omitempty"` + // Context - The workload classifier context. + Context *string `json:"context,omitempty"` + // StartTime - The workload classifier start time for classification. + StartTime *string `json:"startTime,omitempty"` + // EndTime - The workload classifier end time for classification. + EndTime *string `json:"endTime,omitempty"` + // Importance - The workload classifier importance. + Importance *string `json:"importance,omitempty"` +} + +// WorkloadGroup workload group operations for a sql pool +type WorkloadGroup struct { + autorest.Response `json:"-"` + // WorkloadGroupProperties - Resource properties. + *WorkloadGroupProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecord. -func (vasr VulnerabilityAssessmentScanRecord) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for WorkloadGroup. +func (wg WorkloadGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if vasr.VulnerabilityAssessmentScanRecordProperties != nil { - objectMap["properties"] = vasr.VulnerabilityAssessmentScanRecordProperties + if wg.WorkloadGroupProperties != nil { + objectMap["properties"] = wg.WorkloadGroupProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for VulnerabilityAssessmentScanRecord struct. -func (vasr *VulnerabilityAssessmentScanRecord) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for WorkloadGroup struct. +func (wg *WorkloadGroup) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -9088,12 +13578,12 @@ func (vasr *VulnerabilityAssessmentScanRecord) UnmarshalJSON(body []byte) error switch k { case "properties": if v != nil { - var vulnerabilityAssessmentScanRecordProperties VulnerabilityAssessmentScanRecordProperties - err = json.Unmarshal(*v, &vulnerabilityAssessmentScanRecordProperties) + var workloadGroupProperties WorkloadGroupProperties + err = json.Unmarshal(*v, &workloadGroupProperties) if err != nil { return err } - vasr.VulnerabilityAssessmentScanRecordProperties = &vulnerabilityAssessmentScanRecordProperties + wg.WorkloadGroupProperties = &workloadGroupProperties } case "id": if v != nil { @@ -9102,7 +13592,7 @@ func (vasr *VulnerabilityAssessmentScanRecord) UnmarshalJSON(body []byte) error if err != nil { return err } - vasr.ID = &ID + wg.ID = &ID } case "name": if v != nil { @@ -9111,7 +13601,7 @@ func (vasr *VulnerabilityAssessmentScanRecord) UnmarshalJSON(body []byte) error if err != nil { return err } - vasr.Name = &name + wg.Name = &name } case "type": if v != nil { @@ -9120,7 +13610,7 @@ func (vasr *VulnerabilityAssessmentScanRecord) UnmarshalJSON(body []byte) error if err != nil { return err } - vasr.Type = &typeVar + wg.Type = &typeVar } } } @@ -9128,27 +13618,26 @@ func (vasr *VulnerabilityAssessmentScanRecord) UnmarshalJSON(body []byte) error return nil } -// VulnerabilityAssessmentScanRecordListResult a list of vulnerability assessment scan records. -type VulnerabilityAssessmentScanRecordListResult struct { +// WorkloadGroupListResult a list of workload groups. +type WorkloadGroupListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; Array of results. - Value *[]VulnerabilityAssessmentScanRecord `json:"value,omitempty"` + Value *[]WorkloadGroup `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } -// VulnerabilityAssessmentScanRecordListResultIterator provides access to a complete listing of -// VulnerabilityAssessmentScanRecord values. -type VulnerabilityAssessmentScanRecordListResultIterator struct { +// WorkloadGroupListResultIterator provides access to a complete listing of WorkloadGroup values. +type WorkloadGroupListResultIterator struct { i int - page VulnerabilityAssessmentScanRecordListResultPage + page WorkloadGroupListResultPage } // 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 *VulnerabilityAssessmentScanRecordListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *WorkloadGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadGroupListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -9173,67 +13662,67 @@ func (iter *VulnerabilityAssessmentScanRecordListResultIterator) NextWithContext // 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 *VulnerabilityAssessmentScanRecordListResultIterator) Next() error { +func (iter *WorkloadGroupListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VulnerabilityAssessmentScanRecordListResultIterator) NotDone() bool { +func (iter WorkloadGroupListResultIterator) 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 VulnerabilityAssessmentScanRecordListResultIterator) Response() VulnerabilityAssessmentScanRecordListResult { +func (iter WorkloadGroupListResultIterator) Response() WorkloadGroupListResult { 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 VulnerabilityAssessmentScanRecordListResultIterator) Value() VulnerabilityAssessmentScanRecord { +func (iter WorkloadGroupListResultIterator) Value() WorkloadGroup { if !iter.page.NotDone() { - return VulnerabilityAssessmentScanRecord{} + return WorkloadGroup{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultIterator type. -func NewVulnerabilityAssessmentScanRecordListResultIterator(page VulnerabilityAssessmentScanRecordListResultPage) VulnerabilityAssessmentScanRecordListResultIterator { - return VulnerabilityAssessmentScanRecordListResultIterator{page: page} +// Creates a new instance of the WorkloadGroupListResultIterator type. +func NewWorkloadGroupListResultIterator(page WorkloadGroupListResultPage) WorkloadGroupListResultIterator { + return WorkloadGroupListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (vasrlr VulnerabilityAssessmentScanRecordListResult) IsEmpty() bool { - return vasrlr.Value == nil || len(*vasrlr.Value) == 0 +func (wglr WorkloadGroupListResult) IsEmpty() bool { + return wglr.Value == nil || len(*wglr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (vasrlr VulnerabilityAssessmentScanRecordListResult) hasNextLink() bool { - return vasrlr.NextLink != nil && len(*vasrlr.NextLink) != 0 +func (wglr WorkloadGroupListResult) hasNextLink() bool { + return wglr.NextLink != nil && len(*wglr.NextLink) != 0 } -// vulnerabilityAssessmentScanRecordListResultPreparer prepares a request to retrieve the next set of results. +// workloadGroupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (vasrlr VulnerabilityAssessmentScanRecordListResult) vulnerabilityAssessmentScanRecordListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vasrlr.hasNextLink() { +func (wglr WorkloadGroupListResult) workloadGroupListResultPreparer(ctx context.Context) (*http.Request, error) { + if !wglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(vasrlr.NextLink))) + autorest.WithBaseURL(to.String(wglr.NextLink))) } -// VulnerabilityAssessmentScanRecordListResultPage contains a page of VulnerabilityAssessmentScanRecord values. -type VulnerabilityAssessmentScanRecordListResultPage struct { - fn func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error) - vasrlr VulnerabilityAssessmentScanRecordListResult +// WorkloadGroupListResultPage contains a page of WorkloadGroup values. +type WorkloadGroupListResultPage struct { + fn func(context.Context, WorkloadGroupListResult) (WorkloadGroupListResult, error) + wglr WorkloadGroupListResult } // 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 *VulnerabilityAssessmentScanRecordListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *WorkloadGroupListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadGroupListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -9243,11 +13732,11 @@ func (page *VulnerabilityAssessmentScanRecordListResultPage) NextWithContext(ctx }() } for { - next, err := page.fn(ctx, page.vasrlr) + next, err := page.fn(ctx, page.wglr) if err != nil { return err } - page.vasrlr = next + page.wglr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -9258,51 +13747,51 @@ func (page *VulnerabilityAssessmentScanRecordListResultPage) NextWithContext(ctx // 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 *VulnerabilityAssessmentScanRecordListResultPage) Next() error { +func (page *WorkloadGroupListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VulnerabilityAssessmentScanRecordListResultPage) NotDone() bool { - return !page.vasrlr.IsEmpty() +func (page WorkloadGroupListResultPage) NotDone() bool { + return !page.wglr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page VulnerabilityAssessmentScanRecordListResultPage) Response() VulnerabilityAssessmentScanRecordListResult { - return page.vasrlr +func (page WorkloadGroupListResultPage) Response() WorkloadGroupListResult { + return page.wglr } // Values returns the slice of values for the current page or nil if there are no values. -func (page VulnerabilityAssessmentScanRecordListResultPage) Values() []VulnerabilityAssessmentScanRecord { - if page.vasrlr.IsEmpty() { +func (page WorkloadGroupListResultPage) Values() []WorkloadGroup { + if page.wglr.IsEmpty() { return nil } - return *page.vasrlr.Value + return *page.wglr.Value } -// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultPage type. -func NewVulnerabilityAssessmentScanRecordListResultPage(getNextPage func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error)) VulnerabilityAssessmentScanRecordListResultPage { - return VulnerabilityAssessmentScanRecordListResultPage{fn: getNextPage} +// Creates a new instance of the WorkloadGroupListResultPage type. +func NewWorkloadGroupListResultPage(cur WorkloadGroupListResult, getNextPage func(context.Context, WorkloadGroupListResult) (WorkloadGroupListResult, error)) WorkloadGroupListResultPage { + return WorkloadGroupListResultPage{ + fn: getNextPage, + wglr: cur, + } } -// VulnerabilityAssessmentScanRecordProperties properties of a vulnerability assessment scan record. -type VulnerabilityAssessmentScanRecordProperties struct { - // ScanID - READ-ONLY; The scan ID. - ScanID *string `json:"scanId,omitempty"` - // TriggerType - READ-ONLY; The scan trigger type. Possible values include: 'OnDemand', 'Recurring' - TriggerType VulnerabilityAssessmentScanTriggerType `json:"triggerType,omitempty"` - // State - READ-ONLY; The scan status. Possible values include: 'VulnerabilityAssessmentScanStatePassed', 'VulnerabilityAssessmentScanStateFailed', 'VulnerabilityAssessmentScanStateFailedToRun', 'VulnerabilityAssessmentScanStateInProgress' - State VulnerabilityAssessmentScanState `json:"state,omitempty"` - // StartTime - READ-ONLY; The scan start time (UTC). - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; The scan end time (UTC). - EndTime *date.Time `json:"endTime,omitempty"` - // Errors - READ-ONLY; The scan errors. - Errors *[]VulnerabilityAssessmentScanError `json:"errors,omitempty"` - // StorageContainerPath - READ-ONLY; The scan results storage container path. - StorageContainerPath *string `json:"storageContainerPath,omitempty"` - // NumberOfFailedSecurityChecks - READ-ONLY; The number of failed security checks. - NumberOfFailedSecurityChecks *int32 `json:"numberOfFailedSecurityChecks,omitempty"` +// WorkloadGroupProperties workload group definition. For more information look at +// sys.workload_management_workload_groups (DMV). +type WorkloadGroupProperties struct { + // MinResourcePercent - The workload group minimum percentage resource. + MinResourcePercent *int32 `json:"minResourcePercent,omitempty"` + // MaxResourcePercent - The workload group cap percentage resource. + MaxResourcePercent *int32 `json:"maxResourcePercent,omitempty"` + // MinResourcePercentPerRequest - The workload group request minimum grant percentage. + MinResourcePercentPerRequest *float64 `json:"minResourcePercentPerRequest,omitempty"` + // MaxResourcePercentPerRequest - The workload group request maximum grant percentage. + MaxResourcePercentPerRequest *float64 `json:"maxResourcePercentPerRequest,omitempty"` + // Importance - The workload group importance level. + Importance *string `json:"importance,omitempty"` + // QueryExecutionTimeout - The workload group query execution timeout. + QueryExecutionTimeout *int32 `json:"queryExecutionTimeout,omitempty"` } // Workspace a workspace @@ -9316,11 +13805,11 @@ type Workspace struct { Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -9425,11 +13914,11 @@ type WorkspaceAadAdminInfo struct { autorest.Response `json:"-"` // AadAdminProperties - Workspace active directory administrator properties *AadAdminProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -9522,8 +14011,8 @@ func (future *WorkspaceAadAdminsCreateOrUpdateFuture) Result(client WorkspaceAad return } -// WorkspaceAadAdminsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// WorkspaceAadAdminsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type WorkspaceAadAdminsDeleteFuture struct { azure.Future } @@ -9697,8 +14186,158 @@ func (page WorkspaceInfoListResultPage) Values() []Workspace { } // Creates a new instance of the WorkspaceInfoListResultPage type. -func NewWorkspaceInfoListResultPage(getNextPage func(context.Context, WorkspaceInfoListResult) (WorkspaceInfoListResult, error)) WorkspaceInfoListResultPage { - return WorkspaceInfoListResultPage{fn: getNextPage} +func NewWorkspaceInfoListResultPage(cur WorkspaceInfoListResult, getNextPage func(context.Context, WorkspaceInfoListResult) (WorkspaceInfoListResult, error)) WorkspaceInfoListResultPage { + return WorkspaceInfoListResultPage{ + fn: getNextPage, + wilr: cur, + } +} + +// WorkspaceKeyDetails details of the customer managed key associated with the workspace +type WorkspaceKeyDetails struct { + // Name - Workspace Key sub-resource name + Name *string `json:"name,omitempty"` + // KeyVaultURL - Workspace Key sub-resource key vault url + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` +} + +// WorkspaceManagedqlServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type WorkspaceManagedqlServerBlobAuditingPoliciesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WorkspaceManagedqlServerBlobAuditingPoliciesCreateOrUpdateFuture) Result(client WorkspaceManagedqlServerBlobAuditingPoliciesClient) (sbap ServerBlobAuditingPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedqlServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceManagedqlServerBlobAuditingPoliciesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sbap.Response.Response, err = future.GetResult(sender); err == nil && sbap.Response.Response.StatusCode != http.StatusNoContent { + sbap, err = client.CreateOrUpdateResponder(sbap.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedqlServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", sbap.Response.Response, "Failure responding to request") + } + } + return +} + +// WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture) Result(client WorkspaceManagedSQLServerEncryptionProtectorClient) (ep EncryptionProtector, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent { + ep, err = client.CreateOrUpdateResponder(ep.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request") + } + } + return +} + +// WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture) Result(client WorkspaceManagedSQLServerEncryptionProtectorClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture") + return + } + ar.Response = future.Response() + return +} + +// WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring +// and retrieving the results of a long-running operation. +type WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture) Result(client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) (esbap ExtendedServerBlobAuditingPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if esbap.Response.Response, err = future.GetResult(sender); err == nil && esbap.Response.Response.StatusCode != http.StatusNoContent { + esbap, err = client.CreateOrUpdateResponder(esbap.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture", "Result", esbap.Response.Response, "Failure responding to request") + } + } + return +} + +// WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture) Result(client WorkspaceManagedSQLServerSecurityAlertPolicyClient) (ssap ServerSecurityAlertPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ssap.Response.Response, err = future.GetResult(sender); err == nil && ssap.Response.Response.StatusCode != http.StatusNoContent { + ssap, err = client.CreateOrUpdateResponder(ssap.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture", "Result", ssap.Response.Response, "Failure responding to request") + } + } + return } // WorkspacePatchInfo workspace patch details @@ -9772,6 +14411,10 @@ func (wpi *WorkspacePatchInfo) UnmarshalJSON(body []byte) error { type WorkspacePatchProperties struct { // SQLAdministratorLoginPassword - SQL administrator login password SQLAdministratorLoginPassword *string `json:"sqlAdministratorLoginPassword,omitempty"` + // ManagedVirtualNetworkSettings - Managed Virtual Network Settings + ManagedVirtualNetworkSettings *ManagedVirtualNetworkSettings `json:"managedVirtualNetworkSettings,omitempty"` + // BabylonConfiguration - Babylon Configuration + BabylonConfiguration *BabylonConfiguration `json:"babylonConfiguration,omitempty"` // ProvisioningState - READ-ONLY; Resource provisioning state ProvisioningState *string `json:"provisioningState,omitempty"` } @@ -9782,6 +14425,12 @@ func (wpp WorkspacePatchProperties) MarshalJSON() ([]byte, error) { if wpp.SQLAdministratorLoginPassword != nil { objectMap["sqlAdministratorLoginPassword"] = wpp.SQLAdministratorLoginPassword } + if wpp.ManagedVirtualNetworkSettings != nil { + objectMap["managedVirtualNetworkSettings"] = wpp.ManagedVirtualNetworkSettings + } + if wpp.BabylonConfiguration != nil { + objectMap["babylonConfiguration"] = wpp.BabylonConfiguration + } return json.Marshal(objectMap) } @@ -9805,8 +14454,16 @@ type WorkspaceProperties struct { ManagedVirtualNetwork *string `json:"managedVirtualNetwork,omitempty"` // PrivateEndpointConnections - Private endpoint connections to the workspace PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // Encryption - The encryption details of the workspace + Encryption *EncryptionDetails `json:"encryption,omitempty"` + // WorkspaceUID - READ-ONLY; The workspace unique identifier + WorkspaceUID *uuid.UUID `json:"workspaceUID,omitempty"` // ExtraProperties - READ-ONLY; Workspace level configs and feature flags ExtraProperties map[string]interface{} `json:"extraProperties"` + // ManagedVirtualNetworkSettings - Managed Virtual Network Settings + ManagedVirtualNetworkSettings *ManagedVirtualNetworkSettings `json:"managedVirtualNetworkSettings,omitempty"` + // BabylonConfiguration - Babylon Configuration + BabylonConfiguration *BabylonConfiguration `json:"babylonConfiguration,omitempty"` } // MarshalJSON is the custom marshaler for WorkspaceProperties. @@ -9836,11 +14493,20 @@ func (wp WorkspaceProperties) MarshalJSON() ([]byte, error) { if wp.PrivateEndpointConnections != nil { objectMap["privateEndpointConnections"] = wp.PrivateEndpointConnections } + if wp.Encryption != nil { + objectMap["encryption"] = wp.Encryption + } + if wp.ManagedVirtualNetworkSettings != nil { + objectMap["managedVirtualNetworkSettings"] = wp.ManagedVirtualNetworkSettings + } + if wp.BabylonConfiguration != nil { + objectMap["babylonConfiguration"] = wp.BabylonConfiguration + } return json.Marshal(objectMap) } -// WorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// WorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type WorkspacesCreateOrUpdateFuture struct { azure.Future } @@ -9868,7 +14534,8 @@ func (future *WorkspacesCreateOrUpdateFuture) Result(client WorkspacesClient) (w return } -// WorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// WorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type WorkspacesDeleteFuture struct { azure.Future } @@ -9896,7 +14563,60 @@ func (future *WorkspacesDeleteFuture) Result(client WorkspacesClient) (so SetObj return } -// WorkspacesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// WorkspaceSQLAadAdminsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type WorkspaceSQLAadAdminsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WorkspaceSQLAadAdminsCreateOrUpdateFuture) Result(client WorkspaceSQLAadAdminsClient) (waai WorkspaceAadAdminInfo, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceSQLAadAdminsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceSQLAadAdminsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if waai.Response.Response, err = future.GetResult(sender); err == nil && waai.Response.Response.StatusCode != http.StatusNoContent { + waai, err = client.CreateOrUpdateResponder(waai.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceSQLAadAdminsCreateOrUpdateFuture", "Result", waai.Response.Response, "Failure responding to request") + } + } + return +} + +// WorkspaceSQLAadAdminsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type WorkspaceSQLAadAdminsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WorkspaceSQLAadAdminsDeleteFuture) Result(client WorkspaceSQLAadAdminsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceSQLAadAdminsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceSQLAadAdminsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// WorkspacesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type WorkspacesUpdateFuture struct { azure.Future } diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/operations.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/operations.go index 5273e87a6235..1c257d2e3a10 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/operations.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/operations.go @@ -127,7 +127,7 @@ func (client OperationsClient) CheckNameAvailabilityResponder(resp *http.Respons // resourceGroupName - the name of the resource group. The name is case insensitive. // workspaceName - the name of the workspace // operationID - operation ID -func (client OperationsClient) GetAzureAsyncHeaderResult(ctx context.Context, resourceGroupName string, workspaceName string, operationID string) (result SetObject, err error) { +func (client OperationsClient) GetAzureAsyncHeaderResult(ctx context.Context, resourceGroupName string, workspaceName string, operationID string) (result OperationResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.GetAzureAsyncHeaderResult") defer func() { @@ -199,11 +199,11 @@ func (client OperationsClient) GetAzureAsyncHeaderResultSender(req *http.Request // GetAzureAsyncHeaderResultResponder handles the response to the GetAzureAsyncHeaderResult request. The method always // closes the http.Response Body. -func (client OperationsClient) GetAzureAsyncHeaderResultResponder(resp *http.Response) (result SetObject, err error) { +func (client OperationsClient) GetAzureAsyncHeaderResultResponder(resp *http.Response) (result OperationResource, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound, http.StatusInternalServerError), - autorest.ByUnmarshallingJSON(&result.Value), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -289,7 +289,7 @@ func (client OperationsClient) GetLocationHeaderResultSender(req *http.Request) func (client OperationsClient) GetLocationHeaderResultResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privateendpointconnections.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privateendpointconnections.go index 9050fb102b03..62117403ca7e 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privateendpointconnections.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privateendpointconnections.go @@ -45,10 +45,11 @@ func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscription // Create approve or reject a private endpoint connection. // Parameters: +// request - request body of private endpoint connection to create. // resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - the name of the workspace +// workspaceName - the name of the workspace. // privateEndpointConnectionName - the name of the private endpoint connection. -func (client PrivateEndpointConnectionsClient) Create(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsCreateFuture, err error) { +func (client PrivateEndpointConnectionsClient) Create(ctx context.Context, request PrivateEndpointConnection, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsCreateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Create") defer func() { @@ -69,7 +70,7 @@ func (client PrivateEndpointConnectionsClient) Create(ctx context.Context, resou return result, validation.NewError("synapse.PrivateEndpointConnectionsClient", "Create", err.Error()) } - req, err := client.CreatePreparer(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName) + req, err := client.CreatePreparer(ctx, request, resourceGroupName, workspaceName, privateEndpointConnectionName) if err != nil { err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsClient", "Create", nil, "Failure preparing request") return @@ -85,7 +86,7 @@ func (client PrivateEndpointConnectionsClient) Create(ctx context.Context, resou } // CreatePreparer prepares the Create request. -func (client PrivateEndpointConnectionsClient) CreatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (*http.Request, error) { +func (client PrivateEndpointConnectionsClient) CreatePreparer(ctx context.Context, request PrivateEndpointConnection, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -99,9 +100,11 @@ func (client PrivateEndpointConnectionsClient) CreatePreparer(ctx context.Contex } preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(request), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -133,7 +136,7 @@ func (client PrivateEndpointConnectionsClient) CreateResponder(resp *http.Respon // Delete delete a private endpoint connection. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - the name of the workspace +// workspaceName - the name of the workspace. // privateEndpointConnectionName - the name of the private endpoint connection. func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { if tracing.IsEnabled() { @@ -220,7 +223,7 @@ func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Respon // Get gets a private endpoint connection. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - the name of the workspace +// workspaceName - the name of the workspace. // privateEndpointConnectionName - the name of the private endpoint connection. func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { if tracing.IsEnabled() { @@ -307,7 +310,7 @@ func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) // List lists private endpoint connection in workspace. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - the name of the workspace +// workspaceName - the name of the workspace. func (client PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result PrivateEndpointConnectionListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.List") diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privateendpointconnectionsprivatelinkhub.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privateendpointconnectionsprivatelinkhub.go new file mode 100644 index 000000000000..414e8a8b513b --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privateendpointconnectionsprivatelinkhub.go @@ -0,0 +1,171 @@ +package synapse + +// 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" +) + +// PrivateEndpointConnectionsPrivateLinkHubClient is the azure Synapse Analytics Management Client +type PrivateEndpointConnectionsPrivateLinkHubClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionsPrivateLinkHubClient creates an instance of the +// PrivateEndpointConnectionsPrivateLinkHubClient client. +func NewPrivateEndpointConnectionsPrivateLinkHubClient(subscriptionID string) PrivateEndpointConnectionsPrivateLinkHubClient { + return NewPrivateEndpointConnectionsPrivateLinkHubClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionsPrivateLinkHubClientWithBaseURI creates an instance of the +// PrivateEndpointConnectionsPrivateLinkHubClient 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 NewPrivateEndpointConnectionsPrivateLinkHubClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsPrivateLinkHubClient { + return PrivateEndpointConnectionsPrivateLinkHubClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List get all PrivateEndpointConnections in the PrivateLinkHub +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// privateLinkHubName - name of the privateLinkHub +func (client PrivateEndpointConnectionsPrivateLinkHubClient) List(ctx context.Context, resourceGroupName string, privateLinkHubName string) (result PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsPrivateLinkHubClient.List") + defer func() { + sc := -1 + if result.pecfplhrcr.Response.Response != nil { + sc = result.pecfplhrcr.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.MinLength, Rule: 1, 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("synapse.PrivateEndpointConnectionsPrivateLinkHubClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, privateLinkHubName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsPrivateLinkHubClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pecfplhrcr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsPrivateLinkHubClient", "List", resp, "Failure sending request") + return + } + + result.pecfplhrcr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsPrivateLinkHubClient", "List", resp, "Failure responding to request") + } + if result.pecfplhrcr.hasNextLink() && result.pecfplhrcr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateEndpointConnectionsPrivateLinkHubClient) ListPreparer(ctx context.Context, resourceGroupName string, privateLinkHubName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateLinkHubName": autorest.Encode("path", privateLinkHubName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName}/privateEndpointConnections", 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 PrivateEndpointConnectionsPrivateLinkHubClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsPrivateLinkHubClient) ListResponder(resp *http.Response) (result PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client PrivateEndpointConnectionsPrivateLinkHubClient) listNextResults(ctx context.Context, lastResults PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse) (result PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse, err error) { + req, err := lastResults.privateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsPrivateLinkHubClient", "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, "synapse.PrivateEndpointConnectionsPrivateLinkHubClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsPrivateLinkHubClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateEndpointConnectionsPrivateLinkHubClient) ListComplete(ctx context.Context, resourceGroupName string, privateLinkHubName string) (result PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsPrivateLinkHubClient.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, resourceGroupName, privateLinkHubName) + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privatelinkhubs.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privatelinkhubs.go index dbf8e297374c..a032016c059e 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privatelinkhubs.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privatelinkhubs.go @@ -44,10 +44,10 @@ func NewPrivateLinkHubsClientWithBaseURI(baseURI string, subscriptionID string) // CreateOrUpdate creates or updates a privateLinkHub // Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// privateLinkHubName - the name of the privateLinkHub // privateLinkHubInfo - privateLinkHub create or update request properties -func (client PrivateLinkHubsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, privateLinkHubName string, privateLinkHubInfo PrivateLinkHub) (result PrivateLinkHub, err error) { +// resourceGroupName - the name of the resource group. The name is case insensitive. +// privateLinkHubName - name of the privateLinkHub +func (client PrivateLinkHubsClient) CreateOrUpdate(ctx context.Context, privateLinkHubInfo PrivateLinkHub, resourceGroupName string, privateLinkHubName string) (result PrivateLinkHub, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.CreateOrUpdate") defer func() { @@ -68,7 +68,7 @@ func (client PrivateLinkHubsClient) CreateOrUpdate(ctx context.Context, resource return result, validation.NewError("synapse.PrivateLinkHubsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, privateLinkHubName, privateLinkHubInfo) + req, err := client.CreateOrUpdatePreparer(ctx, privateLinkHubInfo, resourceGroupName, privateLinkHubName) if err != nil { err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -90,7 +90,7 @@ func (client PrivateLinkHubsClient) CreateOrUpdate(ctx context.Context, resource } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PrivateLinkHubsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, privateLinkHubName string, privateLinkHubInfo PrivateLinkHub) (*http.Request, error) { +func (client PrivateLinkHubsClient) CreateOrUpdatePreparer(ctx context.Context, privateLinkHubInfo PrivateLinkHub, resourceGroupName string, privateLinkHubName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "privateLinkHubName": autorest.Encode("path", privateLinkHubName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -133,14 +133,14 @@ func (client PrivateLinkHubsClient) CreateOrUpdateResponder(resp *http.Response) // Delete deletes a privateLinkHub // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. -// privateLinkHubName - the name of the privateLinkHub -func (client PrivateLinkHubsClient) Delete(ctx context.Context, resourceGroupName string, privateLinkHubName string) (result autorest.Response, err error) { +// privateLinkHubName - name of the privateLinkHub +func (client PrivateLinkHubsClient) Delete(ctx context.Context, resourceGroupName string, privateLinkHubName string) (result PrivateLinkHubsDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.Delete") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -161,18 +161,12 @@ func (client PrivateLinkHubsClient) Delete(ctx context.Context, resourceGroupNam return } - resp, err := client.DeleteSender(req) + result, err = client.DeleteSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Delete", result.Response(), "Failure sending request") return } - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Delete", resp, "Failure responding to request") - } - return } @@ -199,8 +193,14 @@ func (client PrivateLinkHubsClient) DeletePreparer(ctx context.Context, resource // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client PrivateLinkHubsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client PrivateLinkHubsClient) DeleteSender(req *http.Request) (future PrivateLinkHubsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // DeleteResponder handles the response to the Delete request. The method always @@ -208,7 +208,7 @@ func (client PrivateLinkHubsClient) DeleteSender(req *http.Request) (*http.Respo func (client PrivateLinkHubsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return @@ -217,7 +217,7 @@ func (client PrivateLinkHubsClient) DeleteResponder(resp *http.Response) (result // Get gets a privateLinkHub // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. -// privateLinkHubName - the name of the privateLinkHub +// privateLinkHubName - name of the privateLinkHub func (client PrivateLinkHubsClient) Get(ctx context.Context, resourceGroupName string, privateLinkHubName string) (result PrivateLinkHub, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.Get") @@ -542,10 +542,10 @@ func (client PrivateLinkHubsClient) ListByResourceGroupComplete(ctx context.Cont // Update updates a privateLinkHub // Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// privateLinkHubName - the name of the privateLinkHub // privateLinkHubPatchInfo - privateLinkHub patch request properties -func (client PrivateLinkHubsClient) Update(ctx context.Context, resourceGroupName string, privateLinkHubName string, privateLinkHubPatchInfo PrivateLinkHubPatchInfo) (result PrivateLinkHub, err error) { +// resourceGroupName - the name of the resource group. The name is case insensitive. +// privateLinkHubName - name of the privateLinkHub +func (client PrivateLinkHubsClient) Update(ctx context.Context, privateLinkHubPatchInfo PrivateLinkHubPatchInfo, resourceGroupName string, privateLinkHubName string) (result PrivateLinkHub, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.Update") defer func() { @@ -566,7 +566,7 @@ func (client PrivateLinkHubsClient) Update(ctx context.Context, resourceGroupNam return result, validation.NewError("synapse.PrivateLinkHubsClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, privateLinkHubName, privateLinkHubPatchInfo) + req, err := client.UpdatePreparer(ctx, privateLinkHubPatchInfo, resourceGroupName, privateLinkHubName) if err != nil { err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Update", nil, "Failure preparing request") return @@ -588,7 +588,7 @@ func (client PrivateLinkHubsClient) Update(ctx context.Context, resourceGroupNam } // UpdatePreparer prepares the Update request. -func (client PrivateLinkHubsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, privateLinkHubName string, privateLinkHubPatchInfo PrivateLinkHubPatchInfo) (*http.Request, error) { +func (client PrivateLinkHubsClient) UpdatePreparer(ctx context.Context, privateLinkHubPatchInfo PrivateLinkHubPatchInfo, resourceGroupName string, privateLinkHubName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "privateLinkHubName": autorest.Encode("path", privateLinkHubName), "resourceGroupName": autorest.Encode("path", resourceGroupName), diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/restorabledroppedsqlpools.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/restorabledroppedsqlpools.go new file mode 100644 index 000000000000..088f76c314c2 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/restorabledroppedsqlpools.go @@ -0,0 +1,217 @@ +package synapse + +// 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" +) + +// RestorableDroppedSQLPoolsClient is the azure Synapse Analytics Management Client +type RestorableDroppedSQLPoolsClient struct { + BaseClient +} + +// NewRestorableDroppedSQLPoolsClient creates an instance of the RestorableDroppedSQLPoolsClient client. +func NewRestorableDroppedSQLPoolsClient(subscriptionID string) RestorableDroppedSQLPoolsClient { + return NewRestorableDroppedSQLPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRestorableDroppedSQLPoolsClientWithBaseURI creates an instance of the RestorableDroppedSQLPoolsClient 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 NewRestorableDroppedSQLPoolsClientWithBaseURI(baseURI string, subscriptionID string) RestorableDroppedSQLPoolsClient { + return RestorableDroppedSQLPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a deleted sql pool that can be restored +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// restorableDroppedSQLPoolID - the id of the deleted Sql Pool in the form of +// sqlPoolName,deletionTimeInFileTimeFormat +func (client RestorableDroppedSQLPoolsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, restorableDroppedSQLPoolID string) (result RestorableDroppedSQLPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedSQLPoolsClient.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.MinLength, Rule: 1, 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("synapse.RestorableDroppedSQLPoolsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, restorableDroppedSQLPoolID) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.RestorableDroppedSQLPoolsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.RestorableDroppedSQLPoolsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.RestorableDroppedSQLPoolsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RestorableDroppedSQLPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, restorableDroppedSQLPoolID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "restorableDroppedSqlPoolId": autorest.Encode("path", restorableDroppedSQLPoolID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/restorableDroppedSqlPools/{restorableDroppedSqlPoolId}", 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 RestorableDroppedSQLPoolsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RestorableDroppedSQLPoolsClient) GetResponder(resp *http.Response) (result RestorableDroppedSQLPool, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace gets a list of deleted Sql pools that can be restored +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client RestorableDroppedSQLPoolsClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result RestorableDroppedSQLPoolListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedSQLPoolsClient.ListByWorkspace") + 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.MinLength, Rule: 1, 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("synapse.RestorableDroppedSQLPoolsClient", "ListByWorkspace", err.Error()) + } + + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.RestorableDroppedSQLPoolsClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.RestorableDroppedSQLPoolsClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.RestorableDroppedSQLPoolsClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client RestorableDroppedSQLPoolsClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/restorableDroppedSqlPools", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client RestorableDroppedSQLPoolsClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client RestorableDroppedSQLPoolsClient) ListByWorkspaceResponder(resp *http.Response) (result RestorableDroppedSQLPoolListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolblobauditingpolicies.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolblobauditingpolicies.go index c0fa9be19cdd..220eb9bf5bd2 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolblobauditingpolicies.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolblobauditingpolicies.go @@ -222,3 +222,131 @@ func (client SQLPoolBlobAuditingPoliciesClient) GetResponder(resp *http.Response result.Response = autorest.Response{Response: resp} return } + +// ListBySQLPool lists auditing settings of a Sql pool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +func (client SQLPoolBlobAuditingPoliciesClient) ListBySQLPool(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result SQLPoolBlobAuditingPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolBlobAuditingPoliciesClient.ListBySQLPool") + defer func() { + sc := -1 + if result.spbaplr.Response.Response != nil { + sc = result.spbaplr.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.MinLength, Rule: 1, 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("synapse.SQLPoolBlobAuditingPoliciesClient", "ListBySQLPool", err.Error()) + } + + result.fn = client.listBySQLPoolNextResults + req, err := client.ListBySQLPoolPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolBlobAuditingPoliciesClient", "ListBySQLPool", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySQLPoolSender(req) + if err != nil { + result.spbaplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolBlobAuditingPoliciesClient", "ListBySQLPool", resp, "Failure sending request") + return + } + + result.spbaplr, err = client.ListBySQLPoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolBlobAuditingPoliciesClient", "ListBySQLPool", resp, "Failure responding to request") + } + if result.spbaplr.hasNextLink() && result.spbaplr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListBySQLPoolPreparer prepares the ListBySQLPool request. +func (client SQLPoolBlobAuditingPoliciesClient) ListBySQLPoolPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/auditingSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySQLPoolSender sends the ListBySQLPool request. The method will close the +// http.Response Body if it receives an error. +func (client SQLPoolBlobAuditingPoliciesClient) ListBySQLPoolSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySQLPoolResponder handles the response to the ListBySQLPool request. The method always +// closes the http.Response Body. +func (client SQLPoolBlobAuditingPoliciesClient) ListBySQLPoolResponder(resp *http.Response) (result SQLPoolBlobAuditingPolicyListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySQLPoolNextResults retrieves the next set of results, if any. +func (client SQLPoolBlobAuditingPoliciesClient) listBySQLPoolNextResults(ctx context.Context, lastResults SQLPoolBlobAuditingPolicyListResult) (result SQLPoolBlobAuditingPolicyListResult, err error) { + req, err := lastResults.sQLPoolBlobAuditingPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.SQLPoolBlobAuditingPoliciesClient", "listBySQLPoolNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySQLPoolSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "synapse.SQLPoolBlobAuditingPoliciesClient", "listBySQLPoolNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySQLPoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolBlobAuditingPoliciesClient", "listBySQLPoolNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySQLPoolComplete enumerates all values, automatically crossing page boundaries as required. +func (client SQLPoolBlobAuditingPoliciesClient) ListBySQLPoolComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result SQLPoolBlobAuditingPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolBlobAuditingPoliciesClient.ListBySQLPool") + 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.ListBySQLPool(ctx, resourceGroupName, workspaceName, SQLPoolName) + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolcolumns.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolcolumns.go new file mode 100644 index 000000000000..fd8613d4b60c --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolcolumns.go @@ -0,0 +1,136 @@ +package synapse + +// 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" +) + +// SQLPoolColumnsClient is the azure Synapse Analytics Management Client +type SQLPoolColumnsClient struct { + BaseClient +} + +// NewSQLPoolColumnsClient creates an instance of the SQLPoolColumnsClient client. +func NewSQLPoolColumnsClient(subscriptionID string) SQLPoolColumnsClient { + return NewSQLPoolColumnsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSQLPoolColumnsClientWithBaseURI creates an instance of the SQLPoolColumnsClient 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 NewSQLPoolColumnsClientWithBaseURI(baseURI string, subscriptionID string) SQLPoolColumnsClient { + return SQLPoolColumnsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get Sql pool column +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// schemaName - the name of the schema. +// tableName - the name of the table. +// columnName - the name of the column. +func (client SQLPoolColumnsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string, tableName string, columnName string) (result SQLPoolColumn, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolColumnsClient.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.MinLength, Rule: 1, 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("synapse.SQLPoolColumnsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, schemaName, tableName, columnName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolColumnsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolColumnsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolColumnsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLPoolColumnsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string, tableName string, columnName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "columnName": autorest.Encode("path", columnName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "schemaName": autorest.Encode("path", schemaName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}", 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 SQLPoolColumnsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SQLPoolColumnsClient) GetResponder(resp *http.Response) (result SQLPoolColumn, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolgeobackuppolicies.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolgeobackuppolicies.go index 8958c13706b1..8f086b787056 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolgeobackuppolicies.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolgeobackuppolicies.go @@ -130,3 +130,90 @@ func (client SQLPoolGeoBackupPoliciesClient) GetResponder(resp *http.Response) ( result.Response = autorest.Response{Response: resp} return } + +// List get list of SQL pool geo backup policies +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +func (client SQLPoolGeoBackupPoliciesClient) List(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result GeoBackupPolicyListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolGeoBackupPoliciesClient.List") + 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.MinLength, Rule: 1, 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("synapse.SQLPoolGeoBackupPoliciesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolGeoBackupPoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolGeoBackupPoliciesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolGeoBackupPoliciesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SQLPoolGeoBackupPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/geoBackupPolicies", 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 SQLPoolGeoBackupPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SQLPoolGeoBackupPoliciesClient) ListResponder(resp *http.Response) (result GeoBackupPolicyListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooloperationresults.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooloperationresults.go index 0fb3a590825c..28e0c6979305 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooloperationresults.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooloperationresults.go @@ -125,7 +125,7 @@ func (client SQLPoolOperationResultsClient) GetLocationHeaderResultSender(req *h func (client SQLPoolOperationResultsClient) GetLocationHeaderResultResponder(resp *http.Response) (result SetObject, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolreplicationlinks.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolreplicationlinks.go index c4e791928d14..4446d7f31d14 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolreplicationlinks.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolreplicationlinks.go @@ -43,6 +43,95 @@ func NewSQLPoolReplicationLinksClientWithBaseURI(baseURI string, subscriptionID return SQLPoolReplicationLinksClient{NewWithBaseURI(baseURI, subscriptionID)} } +// GetByName get SQL pool replication link by name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// linkID - the ID of the replication link. +func (client SQLPoolReplicationLinksClient) GetByName(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, linkID string) (result ReplicationLink, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolReplicationLinksClient.GetByName") + 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.MinLength, Rule: 1, 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("synapse.SQLPoolReplicationLinksClient", "GetByName", err.Error()) + } + + req, err := client.GetByNamePreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, linkID) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolReplicationLinksClient", "GetByName", nil, "Failure preparing request") + return + } + + resp, err := client.GetByNameSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolReplicationLinksClient", "GetByName", resp, "Failure sending request") + return + } + + result, err = client.GetByNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolReplicationLinksClient", "GetByName", resp, "Failure responding to request") + } + + return +} + +// GetByNamePreparer prepares the GetByName request. +func (client SQLPoolReplicationLinksClient) GetByNamePreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, linkID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "linkId": autorest.Encode("path", linkID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/replicationLinks/{linkId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByNameSender sends the GetByName request. The method will close the +// http.Response Body if it receives an error. +func (client SQLPoolReplicationLinksClient) GetByNameSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetByNameResponder handles the response to the GetByName request. The method always +// closes the http.Response Body. +func (client SQLPoolReplicationLinksClient) GetByNameResponder(resp *http.Response) (result ReplicationLink, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List lists a Sql pool's replication links. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolrestorepoints.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolrestorepoints.go index efe6a2a25c21..90bb2bf54a5f 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolrestorepoints.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolrestorepoints.go @@ -135,6 +135,183 @@ func (client SQLPoolRestorePointsClient) CreateResponder(resp *http.Response) (r return } +// Delete deletes a restore point. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// restorePointName - the name of the restore point. +func (client SQLPoolRestorePointsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, restorePointName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolRestorePointsClient.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.MinLength, Rule: 1, 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("synapse.SQLPoolRestorePointsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, restorePointName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolRestorePointsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "synapse.SQLPoolRestorePointsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolRestorePointsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SQLPoolRestorePointsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, restorePointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "restorePointName": autorest.Encode("path", restorePointName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/restorePoints/{restorePointName}", 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 SQLPoolRestorePointsClient) 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 SQLPoolRestorePointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a restore point. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// restorePointName - the name of the restore point. +func (client SQLPoolRestorePointsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, restorePointName string) (result RestorePoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolRestorePointsClient.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.MinLength, Rule: 1, 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("synapse.SQLPoolRestorePointsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, restorePointName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolRestorePointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolRestorePointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolRestorePointsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLPoolRestorePointsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, restorePointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "restorePointName": autorest.Encode("path", restorePointName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/restorePoints/{restorePointName}", 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 SQLPoolRestorePointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SQLPoolRestorePointsClient) GetResponder(resp *http.Response) (result RestorePoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List get SQL pool backup information // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpools.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpools.go index d11423278703..40eabdee1d41 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpools.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpools.go @@ -780,7 +780,7 @@ func (client SQLPoolsClient) UpdateSender(req *http.Request) (*http.Response, er func (client SQLPoolsClient) UpdateResponder(resp *http.Response) (result SQLPool, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolschemas.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolschemas.go index a7d0e6fee045..0e37de87b0d7 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolschemas.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolschemas.go @@ -42,6 +42,95 @@ func NewSQLPoolSchemasClientWithBaseURI(baseURI string, subscriptionID string) S return SQLPoolSchemasClient{NewWithBaseURI(baseURI, subscriptionID)} } +// Get get Sql Pool schema +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// schemaName - the name of the schema. +func (client SQLPoolSchemasClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string) (result SQLPoolSchema, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolSchemasClient.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.MinLength, Rule: 1, 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("synapse.SQLPoolSchemasClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, schemaName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolSchemasClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolSchemasClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolSchemasClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLPoolSchemasClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "schemaName": autorest.Encode("path", schemaName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}", 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 SQLPoolSchemasClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SQLPoolSchemasClient) GetResponder(resp *http.Response) (result SQLPoolSchema, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List gets schemas of a given SQL pool. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolsecurityalertpolicies.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolsecurityalertpolicies.go index 454fea827d59..d85eb3ed0aef 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolsecurityalertpolicies.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolsecurityalertpolicies.go @@ -221,3 +221,131 @@ func (client SQLPoolSecurityAlertPoliciesClient) GetResponder(resp *http.Respons result.Response = autorest.Response{Response: resp} return } + +// List get a list of Sql pool's security alert policies. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +func (client SQLPoolSecurityAlertPoliciesClient) List(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result ListSQLPoolSecurityAlertPoliciesPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolSecurityAlertPoliciesClient.List") + defer func() { + sc := -1 + if result.lspsap.Response.Response != nil { + sc = result.lspsap.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.MinLength, Rule: 1, 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("synapse.SQLPoolSecurityAlertPoliciesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolSecurityAlertPoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lspsap.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolSecurityAlertPoliciesClient", "List", resp, "Failure sending request") + return + } + + result.lspsap, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolSecurityAlertPoliciesClient", "List", resp, "Failure responding to request") + } + if result.lspsap.hasNextLink() && result.lspsap.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client SQLPoolSecurityAlertPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/securityAlertPolicies", 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 SQLPoolSecurityAlertPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SQLPoolSecurityAlertPoliciesClient) ListResponder(resp *http.Response) (result ListSQLPoolSecurityAlertPolicies, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SQLPoolSecurityAlertPoliciesClient) listNextResults(ctx context.Context, lastResults ListSQLPoolSecurityAlertPolicies) (result ListSQLPoolSecurityAlertPolicies, err error) { + req, err := lastResults.listSQLPoolSecurityAlertPoliciesPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.SQLPoolSecurityAlertPoliciesClient", "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, "synapse.SQLPoolSecurityAlertPoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolSecurityAlertPoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SQLPoolSecurityAlertPoliciesClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result ListSQLPoolSecurityAlertPoliciesIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolSecurityAlertPoliciesClient.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, resourceGroupName, workspaceName, SQLPoolName) + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolsensitivitylabels.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolsensitivitylabels.go index ffbf3a182aff..6eb4c42f1e4f 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolsensitivitylabels.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolsensitivitylabels.go @@ -227,7 +227,7 @@ func (client SQLPoolSensitivityLabelsClient) DeleteSender(req *http.Request) (*h func (client SQLPoolSensitivityLabelsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return @@ -420,6 +420,101 @@ func (client SQLPoolSensitivityLabelsClient) EnableRecommendationResponder(resp return } +// Get gets the sensitivity label of a given column +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// schemaName - the name of the schema. +// tableName - the name of the table. +// columnName - the name of the column. +// sensitivityLabelSource - the source of the sensitivity label. +func (client SQLPoolSensitivityLabelsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string, tableName string, columnName string, sensitivityLabelSource SensitivityLabelSource) (result SensitivityLabel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolSensitivityLabelsClient.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.MinLength, Rule: 1, 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("synapse.SQLPoolSensitivityLabelsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, schemaName, tableName, columnName, sensitivityLabelSource) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolSensitivityLabelsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolSensitivityLabelsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolSensitivityLabelsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLPoolSensitivityLabelsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string, tableName string, columnName string, sensitivityLabelSource SensitivityLabelSource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "columnName": autorest.Encode("path", columnName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "schemaName": autorest.Encode("path", schemaName), + "sensitivityLabelSource": autorest.Encode("path", sensitivityLabelSource), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", 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 SQLPoolSensitivityLabelsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SQLPoolSensitivityLabelsClient) GetResponder(resp *http.Response) (result SensitivityLabel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // ListCurrent gets SQL pool sensitivity labels. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooltables.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooltables.go index be3bfd1dbd99..52a7465d422e 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooltables.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooltables.go @@ -42,6 +42,97 @@ func NewSQLPoolTablesClientWithBaseURI(baseURI string, subscriptionID string) SQ return SQLPoolTablesClient{NewWithBaseURI(baseURI, subscriptionID)} } +// Get get Sql pool table +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// schemaName - the name of the schema. +// tableName - the name of the table. +func (client SQLPoolTablesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string, tableName string) (result SQLPoolTable, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolTablesClient.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.MinLength, Rule: 1, 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("synapse.SQLPoolTablesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, schemaName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolTablesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolTablesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolTablesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLPoolTablesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "schemaName": autorest.Encode("path", schemaName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}", 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 SQLPoolTablesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SQLPoolTablesClient) GetResponder(resp *http.Response) (result SQLPoolTable, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // ListBySchema gets tables of a given schema in a SQL pool. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooltransparentdataencryptions.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooltransparentdataencryptions.go index c7d9110887a6..98e903d5b392 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooltransparentdataencryptions.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooltransparentdataencryptions.go @@ -223,3 +223,131 @@ func (client SQLPoolTransparentDataEncryptionsClient) GetResponder(resp *http.Re result.Response = autorest.Response{Response: resp} return } + +// List get list of SQL pool's transparent data encryption configurations. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +func (client SQLPoolTransparentDataEncryptionsClient) List(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result TransparentDataEncryptionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolTransparentDataEncryptionsClient.List") + defer func() { + sc := -1 + if result.tdelr.Response.Response != nil { + sc = result.tdelr.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.MinLength, Rule: 1, 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("synapse.SQLPoolTransparentDataEncryptionsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolTransparentDataEncryptionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.tdelr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolTransparentDataEncryptionsClient", "List", resp, "Failure sending request") + return + } + + result.tdelr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolTransparentDataEncryptionsClient", "List", resp, "Failure responding to request") + } + if result.tdelr.hasNextLink() && result.tdelr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client SQLPoolTransparentDataEncryptionsClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/transparentDataEncryption", 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 SQLPoolTransparentDataEncryptionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SQLPoolTransparentDataEncryptionsClient) ListResponder(resp *http.Response) (result TransparentDataEncryptionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SQLPoolTransparentDataEncryptionsClient) listNextResults(ctx context.Context, lastResults TransparentDataEncryptionListResult) (result TransparentDataEncryptionListResult, err error) { + req, err := lastResults.transparentDataEncryptionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.SQLPoolTransparentDataEncryptionsClient", "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, "synapse.SQLPoolTransparentDataEncryptionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolTransparentDataEncryptionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SQLPoolTransparentDataEncryptionsClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result TransparentDataEncryptionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolTransparentDataEncryptionsClient.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, resourceGroupName, workspaceName, SQLPoolName) + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolvulnerabilityassessmentrulebaselines.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolvulnerabilityassessmentrulebaselines.go index d3985e125a80..d254ce919ebf 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolvulnerabilityassessmentrulebaselines.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolvulnerabilityassessmentrulebaselines.go @@ -229,8 +229,101 @@ func (client SQLPoolVulnerabilityAssessmentRuleBaselinesClient) DeleteSender(req func (client SQLPoolVulnerabilityAssessmentRuleBaselinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } + +// Get gets a SqlPool's vulnerability assessment rule baseline. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// ruleID - the vulnerability assessment rule ID. +// baselineName - the name of the vulnerability assessment rule baseline (default implies a baseline on a Sql +// pool level rule and master for server level rule). +func (client SQLPoolVulnerabilityAssessmentRuleBaselinesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName) (result SQLPoolVulnerabilityAssessmentRuleBaseline, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolVulnerabilityAssessmentRuleBaselinesClient.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.MinLength, Rule: 1, 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("synapse.SQLPoolVulnerabilityAssessmentRuleBaselinesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, ruleID, baselineName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolVulnerabilityAssessmentRuleBaselinesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolVulnerabilityAssessmentRuleBaselinesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolVulnerabilityAssessmentRuleBaselinesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLPoolVulnerabilityAssessmentRuleBaselinesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "baselineName": autorest.Encode("path", baselineName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleId": autorest.Encode("path", ruleID), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vulnerabilityAssessmentName": autorest.Encode("path", "default"), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}", 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 SQLPoolVulnerabilityAssessmentRuleBaselinesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SQLPoolVulnerabilityAssessmentRuleBaselinesClient) GetResponder(resp *http.Response) (result SQLPoolVulnerabilityAssessmentRuleBaseline, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolvulnerabilityassessments.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolvulnerabilityassessments.go index c23908fb41c7..2d1b38135cca 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolvulnerabilityassessments.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolvulnerabilityassessments.go @@ -215,7 +215,7 @@ func (client SQLPoolVulnerabilityAssessmentsClient) DeleteSender(req *http.Reque func (client SQLPoolVulnerabilityAssessmentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolvulnerabilityassessmentscans.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolvulnerabilityassessmentscans.go index 6203c54eb277..bf5ef5270b3c 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolvulnerabilityassessmentscans.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolvulnerabilityassessmentscans.go @@ -134,6 +134,96 @@ func (client SQLPoolVulnerabilityAssessmentScansClient) ExportResponder(resp *ht return } +// Get gets a vulnerability assessment scan record of a Sql pool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// scanID - the vulnerability assessment scan Id of the scan to retrieve. +func (client SQLPoolVulnerabilityAssessmentScansClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, scanID string) (result VulnerabilityAssessmentScanRecord, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolVulnerabilityAssessmentScansClient.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.MinLength, Rule: 1, 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("synapse.SQLPoolVulnerabilityAssessmentScansClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, scanID) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolVulnerabilityAssessmentScansClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolVulnerabilityAssessmentScansClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolVulnerabilityAssessmentScansClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLPoolVulnerabilityAssessmentScansClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, scanID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scanId": autorest.Encode("path", scanID), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vulnerabilityAssessmentName": autorest.Encode("path", "default"), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SQLPoolVulnerabilityAssessmentScansClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SQLPoolVulnerabilityAssessmentScansClient) GetResponder(resp *http.Response) (result VulnerabilityAssessmentScanRecord, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // InitiateScan executes a Vulnerability Assessment database scan. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolworkloadclassifier.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolworkloadclassifier.go new file mode 100644 index 000000000000..bcd2919d2316 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolworkloadclassifier.go @@ -0,0 +1,452 @@ +package synapse + +// 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" +) + +// SQLPoolWorkloadClassifierClient is the azure Synapse Analytics Management Client +type SQLPoolWorkloadClassifierClient struct { + BaseClient +} + +// NewSQLPoolWorkloadClassifierClient creates an instance of the SQLPoolWorkloadClassifierClient client. +func NewSQLPoolWorkloadClassifierClient(subscriptionID string) SQLPoolWorkloadClassifierClient { + return NewSQLPoolWorkloadClassifierClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSQLPoolWorkloadClassifierClientWithBaseURI creates an instance of the SQLPoolWorkloadClassifierClient 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 NewSQLPoolWorkloadClassifierClientWithBaseURI(baseURI string, subscriptionID string) SQLPoolWorkloadClassifierClient { + return SQLPoolWorkloadClassifierClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create Or Update workload classifier for a Sql pool's workload group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// workloadGroupName - the name of the workload group. +// workloadClassifierName - the name of the workload classifier. +// parameters - the properties of the workload classifier. +func (client SQLPoolWorkloadClassifierClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string, workloadClassifierName string, parameters WorkloadClassifier) (result SQLPoolWorkloadClassifierCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolWorkloadClassifierClient.CreateOrUpdate") + 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.MinLength, Rule: 1, 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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.WorkloadClassifierProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkloadClassifierProperties.MemberName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("synapse.SQLPoolWorkloadClassifierClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, workloadGroupName, workloadClassifierName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SQLPoolWorkloadClassifierClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string, workloadClassifierName string, parameters WorkloadClassifier) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workloadClassifierName": autorest.Encode("path", workloadClassifierName), + "workloadGroupName": autorest.Encode("path", workloadGroupName), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SQLPoolWorkloadClassifierClient) CreateOrUpdateSender(req *http.Request) (future SQLPoolWorkloadClassifierCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SQLPoolWorkloadClassifierClient) CreateOrUpdateResponder(resp *http.Response) (result WorkloadClassifier, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete remove workload classifier of a Sql pool's workload group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// workloadGroupName - the name of the workload group. +// workloadClassifierName - the name of the workload classifier. +func (client SQLPoolWorkloadClassifierClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string, workloadClassifierName string) (result SQLPoolWorkloadClassifierDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolWorkloadClassifierClient.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.MinLength, Rule: 1, 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("synapse.SQLPoolWorkloadClassifierClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, workloadGroupName, workloadClassifierName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SQLPoolWorkloadClassifierClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string, workloadClassifierName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workloadClassifierName": autorest.Encode("path", workloadClassifierName), + "workloadGroupName": autorest.Encode("path", workloadGroupName), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}", 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 SQLPoolWorkloadClassifierClient) DeleteSender(req *http.Request) (future SQLPoolWorkloadClassifierDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SQLPoolWorkloadClassifierClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a workload classifier of Sql pool's workload group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// workloadGroupName - the name of the workload group. +// workloadClassifierName - the name of the workload classifier. +func (client SQLPoolWorkloadClassifierClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string, workloadClassifierName string) (result WorkloadClassifier, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolWorkloadClassifierClient.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.MinLength, Rule: 1, 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("synapse.SQLPoolWorkloadClassifierClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, workloadGroupName, workloadClassifierName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLPoolWorkloadClassifierClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string, workloadClassifierName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workloadClassifierName": autorest.Encode("path", workloadClassifierName), + "workloadGroupName": autorest.Encode("path", workloadGroupName), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}", 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 SQLPoolWorkloadClassifierClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SQLPoolWorkloadClassifierClient) GetResponder(resp *http.Response) (result WorkloadClassifier, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List get list of Sql pool's workload classifier for workload groups. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// workloadGroupName - the name of the workload group. +func (client SQLPoolWorkloadClassifierClient) List(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string) (result WorkloadClassifierListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolWorkloadClassifierClient.List") + defer func() { + sc := -1 + if result.wclr.Response.Response != nil { + sc = result.wclr.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.MinLength, Rule: 1, 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("synapse.SQLPoolWorkloadClassifierClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, workloadGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.wclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierClient", "List", resp, "Failure sending request") + return + } + + result.wclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierClient", "List", resp, "Failure responding to request") + } + if result.wclr.hasNextLink() && result.wclr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client SQLPoolWorkloadClassifierClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workloadGroupName": autorest.Encode("path", workloadGroupName), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers", 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 SQLPoolWorkloadClassifierClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SQLPoolWorkloadClassifierClient) ListResponder(resp *http.Response) (result WorkloadClassifierListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SQLPoolWorkloadClassifierClient) listNextResults(ctx context.Context, lastResults WorkloadClassifierListResult) (result WorkloadClassifierListResult, err error) { + req, err := lastResults.workloadClassifierListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierClient", "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, "synapse.SQLPoolWorkloadClassifierClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SQLPoolWorkloadClassifierClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string) (result WorkloadClassifierListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolWorkloadClassifierClient.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, resourceGroupName, workspaceName, SQLPoolName, workloadGroupName) + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolworkloadgroup.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolworkloadgroup.go new file mode 100644 index 000000000000..2c29af8b0741 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolworkloadgroup.go @@ -0,0 +1,447 @@ +package synapse + +// 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" +) + +// SQLPoolWorkloadGroupClient is the azure Synapse Analytics Management Client +type SQLPoolWorkloadGroupClient struct { + BaseClient +} + +// NewSQLPoolWorkloadGroupClient creates an instance of the SQLPoolWorkloadGroupClient client. +func NewSQLPoolWorkloadGroupClient(subscriptionID string) SQLPoolWorkloadGroupClient { + return NewSQLPoolWorkloadGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSQLPoolWorkloadGroupClientWithBaseURI creates an instance of the SQLPoolWorkloadGroupClient 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 NewSQLPoolWorkloadGroupClientWithBaseURI(baseURI string, subscriptionID string) SQLPoolWorkloadGroupClient { + return SQLPoolWorkloadGroupClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create Or Update a Sql pool's workload group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// workloadGroupName - the name of the workload group. +// parameters - the requested workload group state. +func (client SQLPoolWorkloadGroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string, parameters WorkloadGroup) (result SQLPoolWorkloadGroupCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolWorkloadGroupClient.CreateOrUpdate") + 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.MinLength, Rule: 1, 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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.WorkloadGroupProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkloadGroupProperties.MinResourcePercent", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.WorkloadGroupProperties.MaxResourcePercent", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.WorkloadGroupProperties.MinResourcePercentPerRequest", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("synapse.SQLPoolWorkloadGroupClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, workloadGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SQLPoolWorkloadGroupClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string, parameters WorkloadGroup) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workloadGroupName": autorest.Encode("path", workloadGroupName), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SQLPoolWorkloadGroupClient) CreateOrUpdateSender(req *http.Request) (future SQLPoolWorkloadGroupCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SQLPoolWorkloadGroupClient) CreateOrUpdateResponder(resp *http.Response) (result WorkloadGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete remove Sql pool's workload group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// workloadGroupName - the name of the workload group. +func (client SQLPoolWorkloadGroupClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string) (result SQLPoolWorkloadGroupDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolWorkloadGroupClient.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.MinLength, Rule: 1, 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("synapse.SQLPoolWorkloadGroupClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, workloadGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SQLPoolWorkloadGroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workloadGroupName": autorest.Encode("path", workloadGroupName), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}", 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 SQLPoolWorkloadGroupClient) DeleteSender(req *http.Request) (future SQLPoolWorkloadGroupDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SQLPoolWorkloadGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a Sql pool's workload group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +// workloadGroupName - the name of the workload group. +func (client SQLPoolWorkloadGroupClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string) (result WorkloadGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolWorkloadGroupClient.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.MinLength, Rule: 1, 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("synapse.SQLPoolWorkloadGroupClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, workloadGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLPoolWorkloadGroupClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workloadGroupName": autorest.Encode("path", workloadGroupName), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}", 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 SQLPoolWorkloadGroupClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SQLPoolWorkloadGroupClient) GetResponder(resp *http.Response) (result WorkloadGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List get list of Sql pool's workload groups. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLPoolName - SQL pool name +func (client SQLPoolWorkloadGroupClient) List(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result WorkloadGroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolWorkloadGroupClient.List") + defer func() { + sc := -1 + if result.wglr.Response.Response != nil { + sc = result.wglr.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.MinLength, Rule: 1, 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("synapse.SQLPoolWorkloadGroupClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName, SQLPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.wglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupClient", "List", resp, "Failure sending request") + return + } + + result.wglr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupClient", "List", resp, "Failure responding to request") + } + if result.wglr.hasNextLink() && result.wglr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client SQLPoolWorkloadGroupClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlPoolName": autorest.Encode("path", SQLPoolName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups", 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 SQLPoolWorkloadGroupClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SQLPoolWorkloadGroupClient) ListResponder(resp *http.Response) (result WorkloadGroupListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SQLPoolWorkloadGroupClient) listNextResults(ctx context.Context, lastResults WorkloadGroupListResult) (result WorkloadGroupListResult, err error) { + req, err := lastResults.workloadGroupListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupClient", "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, "synapse.SQLPoolWorkloadGroupClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SQLPoolWorkloadGroupClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result WorkloadGroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolWorkloadGroupClient.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, resourceGroupName, workspaceName, SQLPoolName) + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/synapseapi/interfaces.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/synapseapi/interfaces.go index 7b153bd7609e..d5c745a2a485 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/synapseapi/interfaces.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/synapseapi/interfaces.go @@ -38,7 +38,7 @@ var _ BigDataPoolsClientAPI = (*synapse.BigDataPoolsClient)(nil) // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { CheckNameAvailability(ctx context.Context, request synapse.CheckNameAvailabilityRequest) (result synapse.CheckNameAvailabilityResponse, err error) - GetAzureAsyncHeaderResult(ctx context.Context, resourceGroupName string, workspaceName string, operationID string) (result synapse.SetObject, err error) + GetAzureAsyncHeaderResult(ctx context.Context, resourceGroupName string, workspaceName string, operationID string) (result synapse.OperationResource, err error) GetLocationHeaderResult(ctx context.Context, resourceGroupName string, workspaceName string, operationID string) (result autorest.Response, err error) List(ctx context.Context) (result synapse.ListAvailableRpOperation, err error) } @@ -90,6 +90,7 @@ var _ SQLPoolOperationResultsClientAPI = (*synapse.SQLPoolOperationResultsClient // SQLPoolGeoBackupPoliciesClientAPI contains the set of methods on the SQLPoolGeoBackupPoliciesClient type. type SQLPoolGeoBackupPoliciesClientAPI interface { Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.GeoBackupPolicy, err error) + List(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.GeoBackupPolicyListResult, err error) } var _ SQLPoolGeoBackupPoliciesClientAPI = (*synapse.SQLPoolGeoBackupPoliciesClient)(nil) @@ -104,6 +105,8 @@ var _ SQLPoolDataWarehouseUserActivitiesClientAPI = (*synapse.SQLPoolDataWarehou // SQLPoolRestorePointsClientAPI contains the set of methods on the SQLPoolRestorePointsClient type. type SQLPoolRestorePointsClientAPI interface { Create(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, parameters synapse.CreateSQLPoolRestorePointDefinition) (result synapse.SQLPoolRestorePointsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, restorePointName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, restorePointName string) (result synapse.RestorePoint, err error) List(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.RestorePointListResultPage, err error) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.RestorePointListResultIterator, err error) } @@ -112,6 +115,7 @@ var _ SQLPoolRestorePointsClientAPI = (*synapse.SQLPoolRestorePointsClient)(nil) // SQLPoolReplicationLinksClientAPI contains the set of methods on the SQLPoolReplicationLinksClient type. type SQLPoolReplicationLinksClientAPI interface { + GetByName(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, linkID string) (result synapse.ReplicationLink, err error) List(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.ReplicationLinkListResultPage, err error) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.ReplicationLinkListResultIterator, err error) } @@ -122,6 +126,8 @@ var _ SQLPoolReplicationLinksClientAPI = (*synapse.SQLPoolReplicationLinksClient type SQLPoolTransparentDataEncryptionsClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, parameters synapse.TransparentDataEncryption) (result synapse.TransparentDataEncryption, err error) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.TransparentDataEncryption, err error) + List(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.TransparentDataEncryptionListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.TransparentDataEncryptionListResultIterator, err error) } var _ SQLPoolTransparentDataEncryptionsClientAPI = (*synapse.SQLPoolTransparentDataEncryptionsClient)(nil) @@ -130,6 +136,8 @@ var _ SQLPoolTransparentDataEncryptionsClientAPI = (*synapse.SQLPoolTransparentD type SQLPoolBlobAuditingPoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, parameters synapse.SQLPoolBlobAuditingPolicy) (result synapse.SQLPoolBlobAuditingPolicy, err error) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.SQLPoolBlobAuditingPolicy, err error) + ListBySQLPool(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.SQLPoolBlobAuditingPolicyListResultPage, err error) + ListBySQLPoolComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.SQLPoolBlobAuditingPolicyListResultIterator, err error) } var _ SQLPoolBlobAuditingPoliciesClientAPI = (*synapse.SQLPoolBlobAuditingPoliciesClient)(nil) @@ -156,6 +164,7 @@ type SQLPoolSensitivityLabelsClientAPI interface { Delete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) DisableRecommendation(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) EnableRecommendation(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string, tableName string, columnName string, sensitivityLabelSource synapse.SensitivityLabelSource) (result synapse.SensitivityLabel, err error) ListCurrent(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, filter string) (result synapse.SensitivityLabelListResultPage, err error) ListCurrentComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, filter string) (result synapse.SensitivityLabelListResultIterator, err error) ListRecommended(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, includeDisabledRecommendations *bool, skipToken string, filter string) (result synapse.SensitivityLabelListResultPage, err error) @@ -166,6 +175,7 @@ var _ SQLPoolSensitivityLabelsClientAPI = (*synapse.SQLPoolSensitivityLabelsClie // SQLPoolSchemasClientAPI contains the set of methods on the SQLPoolSchemasClient type. type SQLPoolSchemasClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string) (result synapse.SQLPoolSchema, err error) List(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, filter string) (result synapse.SQLPoolSchemaListResultPage, err error) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, filter string) (result synapse.SQLPoolSchemaListResultIterator, err error) } @@ -174,6 +184,7 @@ var _ SQLPoolSchemasClientAPI = (*synapse.SQLPoolSchemasClient)(nil) // SQLPoolTablesClientAPI contains the set of methods on the SQLPoolTablesClient type. type SQLPoolTablesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string, tableName string) (result synapse.SQLPoolTable, err error) ListBySchema(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string, filter string) (result synapse.SQLPoolTableListResultPage, err error) ListBySchemaComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string, filter string) (result synapse.SQLPoolTableListResultIterator, err error) } @@ -209,6 +220,7 @@ var _ SQLPoolVulnerabilityAssessmentsClientAPI = (*synapse.SQLPoolVulnerabilityA // SQLPoolVulnerabilityAssessmentScansClientAPI contains the set of methods on the SQLPoolVulnerabilityAssessmentScansClient type. type SQLPoolVulnerabilityAssessmentScansClientAPI interface { Export(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, scanID string) (result synapse.SQLPoolVulnerabilityAssessmentScansExport, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, scanID string) (result synapse.VulnerabilityAssessmentScanRecord, err error) InitiateScan(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, scanID string) (result synapse.SQLPoolVulnerabilityAssessmentScansInitiateScanFuture, err error) List(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.VulnerabilityAssessmentScanRecordListResultPage, err error) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.VulnerabilityAssessmentScanRecordListResultIterator, err error) @@ -220,6 +232,8 @@ var _ SQLPoolVulnerabilityAssessmentScansClientAPI = (*synapse.SQLPoolVulnerabil type SQLPoolSecurityAlertPoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, parameters synapse.SQLPoolSecurityAlertPolicy) (result synapse.SQLPoolSecurityAlertPolicy, err error) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.SQLPoolSecurityAlertPolicy, err error) + List(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.ListSQLPoolSecurityAlertPoliciesPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.ListSQLPoolSecurityAlertPoliciesIterator, err error) } var _ SQLPoolSecurityAlertPoliciesClientAPI = (*synapse.SQLPoolSecurityAlertPoliciesClient)(nil) @@ -228,10 +242,66 @@ var _ SQLPoolSecurityAlertPoliciesClientAPI = (*synapse.SQLPoolSecurityAlertPoli type SQLPoolVulnerabilityAssessmentRuleBaselinesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, ruleID string, baselineName synapse.VulnerabilityAssessmentPolicyBaselineName, parameters synapse.SQLPoolVulnerabilityAssessmentRuleBaseline) (result synapse.SQLPoolVulnerabilityAssessmentRuleBaseline, err error) Delete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, ruleID string, baselineName synapse.VulnerabilityAssessmentPolicyBaselineName) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, ruleID string, baselineName synapse.VulnerabilityAssessmentPolicyBaselineName) (result synapse.SQLPoolVulnerabilityAssessmentRuleBaseline, err error) } var _ SQLPoolVulnerabilityAssessmentRuleBaselinesClientAPI = (*synapse.SQLPoolVulnerabilityAssessmentRuleBaselinesClient)(nil) +// ExtendedSQLPoolBlobAuditingPoliciesClientAPI contains the set of methods on the ExtendedSQLPoolBlobAuditingPoliciesClient type. +type ExtendedSQLPoolBlobAuditingPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, parameters synapse.ExtendedSQLPoolBlobAuditingPolicy) (result synapse.ExtendedSQLPoolBlobAuditingPolicy, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.ExtendedSQLPoolBlobAuditingPolicy, err error) + ListBySQLPool(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.ExtendedSQLPoolBlobAuditingPolicyListResultPage, err error) + ListBySQLPoolComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.ExtendedSQLPoolBlobAuditingPolicyListResultIterator, err error) +} + +var _ ExtendedSQLPoolBlobAuditingPoliciesClientAPI = (*synapse.ExtendedSQLPoolBlobAuditingPoliciesClient)(nil) + +// DataMaskingPoliciesClientAPI contains the set of methods on the DataMaskingPoliciesClient type. +type DataMaskingPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, parameters synapse.DataMaskingPolicy) (result synapse.DataMaskingPolicy, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.DataMaskingPolicy, err error) +} + +var _ DataMaskingPoliciesClientAPI = (*synapse.DataMaskingPoliciesClient)(nil) + +// DataMaskingRulesClientAPI contains the set of methods on the DataMaskingRulesClient type. +type DataMaskingRulesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, dataMaskingRuleName string, parameters synapse.DataMaskingRule) (result synapse.DataMaskingRule, err error) + ListBySQLPool(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.DataMaskingRuleListResult, err error) +} + +var _ DataMaskingRulesClientAPI = (*synapse.DataMaskingRulesClient)(nil) + +// SQLPoolColumnsClientAPI contains the set of methods on the SQLPoolColumnsClient type. +type SQLPoolColumnsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, schemaName string, tableName string, columnName string) (result synapse.SQLPoolColumn, err error) +} + +var _ SQLPoolColumnsClientAPI = (*synapse.SQLPoolColumnsClient)(nil) + +// SQLPoolWorkloadGroupClientAPI contains the set of methods on the SQLPoolWorkloadGroupClient type. +type SQLPoolWorkloadGroupClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string, parameters synapse.WorkloadGroup) (result synapse.SQLPoolWorkloadGroupCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string) (result synapse.SQLPoolWorkloadGroupDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string) (result synapse.WorkloadGroup, err error) + List(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.WorkloadGroupListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string) (result synapse.WorkloadGroupListResultIterator, err error) +} + +var _ SQLPoolWorkloadGroupClientAPI = (*synapse.SQLPoolWorkloadGroupClient)(nil) + +// SQLPoolWorkloadClassifierClientAPI contains the set of methods on the SQLPoolWorkloadClassifierClient type. +type SQLPoolWorkloadClassifierClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string, workloadClassifierName string, parameters synapse.WorkloadClassifier) (result synapse.SQLPoolWorkloadClassifierCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string, workloadClassifierName string) (result synapse.SQLPoolWorkloadClassifierDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string, workloadClassifierName string) (result synapse.WorkloadClassifier, err error) + List(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string) (result synapse.WorkloadClassifierListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, workloadGroupName string) (result synapse.WorkloadClassifierListResultIterator, err error) +} + +var _ SQLPoolWorkloadClassifierClientAPI = (*synapse.SQLPoolWorkloadClassifierClient)(nil) + // WorkspacesClientAPI contains the set of methods on the WorkspacesClient type. type WorkspacesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, workspaceInfo synapse.Workspace) (result synapse.WorkspacesCreateOrUpdateFuture, err error) @@ -255,6 +325,15 @@ type WorkspaceAadAdminsClientAPI interface { var _ WorkspaceAadAdminsClientAPI = (*synapse.WorkspaceAadAdminsClient)(nil) +// WorkspaceSQLAadAdminsClientAPI contains the set of methods on the WorkspaceSQLAadAdminsClient type. +type WorkspaceSQLAadAdminsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, aadAdminInfo synapse.WorkspaceAadAdminInfo) (result synapse.WorkspaceSQLAadAdminsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.WorkspaceSQLAadAdminsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.WorkspaceAadAdminInfo, err error) +} + +var _ WorkspaceSQLAadAdminsClientAPI = (*synapse.WorkspaceSQLAadAdminsClient)(nil) + // WorkspaceManagedIdentitySQLControlSettingsClientAPI contains the set of methods on the WorkspaceManagedIdentitySQLControlSettingsClient type. type WorkspaceManagedIdentitySQLControlSettingsClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, managedIdentitySQLControlSettings synapse.ManagedIdentitySQLControlSettingsModel) (result synapse.ManagedIdentitySQLControlSettingsModel, err error) @@ -263,15 +342,24 @@ type WorkspaceManagedIdentitySQLControlSettingsClientAPI interface { var _ WorkspaceManagedIdentitySQLControlSettingsClientAPI = (*synapse.WorkspaceManagedIdentitySQLControlSettingsClient)(nil) +// RestorableDroppedSQLPoolsClientAPI contains the set of methods on the RestorableDroppedSQLPoolsClient type. +type RestorableDroppedSQLPoolsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workspaceName string, restorableDroppedSQLPoolID string) (result synapse.RestorableDroppedSQLPool, err error) + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.RestorableDroppedSQLPoolListResult, err error) +} + +var _ RestorableDroppedSQLPoolsClientAPI = (*synapse.RestorableDroppedSQLPoolsClient)(nil) + // IntegrationRuntimesClientAPI contains the set of methods on the IntegrationRuntimesClient type. type IntegrationRuntimesClientAPI interface { Create(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, integrationRuntime synapse.IntegrationRuntimeResource, ifMatch string) (result synapse.IntegrationRuntimesCreateFuture, err error) Delete(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result synapse.IntegrationRuntimesDeleteFuture, err error) + EnableInteractiveQuery(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result synapse.IntegrationRuntimesEnableInteractiveQueryFuture, err error) Get(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, ifNoneMatch string) (result synapse.IntegrationRuntimeResource, err error) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.IntegrationRuntimeListResponsePage, err error) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.IntegrationRuntimeListResponseIterator, err error) - Start(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result synapse.IntegrationRuntimeStatusResponse, err error) - Stop(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result autorest.Response, err error) + Start(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result synapse.IntegrationRuntimesStartFuture, err error) + Stop(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result synapse.IntegrationRuntimesStopFuture, err error) Update(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, updateIntegrationRuntimeRequest synapse.UpdateIntegrationRuntimeRequest) (result synapse.IntegrationRuntimeResource, err error) Upgrade(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result autorest.Response, err error) } @@ -287,8 +375,8 @@ var _ IntegrationRuntimeNodeIPAddressClientAPI = (*synapse.IntegrationRuntimeNod // IntegrationRuntimeObjectMetadataClientAPI contains the set of methods on the IntegrationRuntimeObjectMetadataClient type. type IntegrationRuntimeObjectMetadataClientAPI interface { - Get(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, getMetadataRequest *synapse.GetSsisObjectMetadataRequest) (result synapse.SsisObjectMetadataListResponse, err error) - Refresh(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result synapse.SsisObjectMetadataStatusResponse, err error) + List(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, getMetadataRequest *synapse.GetSsisObjectMetadataRequest) (result synapse.SsisObjectMetadataListResponse, err error) + Refresh(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result synapse.IntegrationRuntimeObjectMetadataRefreshFuture, err error) } var _ IntegrationRuntimeObjectMetadataClientAPI = (*synapse.IntegrationRuntimeObjectMetadataClient)(nil) @@ -326,7 +414,7 @@ var _ IntegrationRuntimeAuthKeysClientAPI = (*synapse.IntegrationRuntimeAuthKeys // IntegrationRuntimeMonitoringDataClientAPI contains the set of methods on the IntegrationRuntimeMonitoringDataClient type. type IntegrationRuntimeMonitoringDataClientAPI interface { - Get(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result synapse.IntegrationRuntimeMonitoringData, err error) + List(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result synapse.IntegrationRuntimeMonitoringData, err error) } var _ IntegrationRuntimeMonitoringDataClientAPI = (*synapse.IntegrationRuntimeMonitoringDataClient)(nil) @@ -349,7 +437,7 @@ var _ PrivateLinkResourcesClientAPI = (*synapse.PrivateLinkResourcesClient)(nil) // PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. type PrivateEndpointConnectionsClientAPI interface { - Create(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result synapse.PrivateEndpointConnectionsCreateFuture, err error) + Create(ctx context.Context, request synapse.PrivateEndpointConnection, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result synapse.PrivateEndpointConnectionsCreateFuture, err error) Delete(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result synapse.PrivateEndpointConnectionsDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result synapse.PrivateEndpointConnection, err error) List(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.PrivateEndpointConnectionListPage, err error) @@ -360,14 +448,108 @@ var _ PrivateEndpointConnectionsClientAPI = (*synapse.PrivateEndpointConnections // PrivateLinkHubsClientAPI contains the set of methods on the PrivateLinkHubsClient type. type PrivateLinkHubsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, privateLinkHubName string, privateLinkHubInfo synapse.PrivateLinkHub) (result synapse.PrivateLinkHub, err error) - Delete(ctx context.Context, resourceGroupName string, privateLinkHubName string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, privateLinkHubInfo synapse.PrivateLinkHub, resourceGroupName string, privateLinkHubName string) (result synapse.PrivateLinkHub, err error) + Delete(ctx context.Context, resourceGroupName string, privateLinkHubName string) (result synapse.PrivateLinkHubsDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, privateLinkHubName string) (result synapse.PrivateLinkHub, err error) List(ctx context.Context) (result synapse.PrivateLinkHubInfoListResultPage, err error) ListComplete(ctx context.Context) (result synapse.PrivateLinkHubInfoListResultIterator, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result synapse.PrivateLinkHubInfoListResultPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result synapse.PrivateLinkHubInfoListResultIterator, err error) - Update(ctx context.Context, resourceGroupName string, privateLinkHubName string, privateLinkHubPatchInfo synapse.PrivateLinkHubPatchInfo) (result synapse.PrivateLinkHub, err error) + Update(ctx context.Context, privateLinkHubPatchInfo synapse.PrivateLinkHubPatchInfo, resourceGroupName string, privateLinkHubName string) (result synapse.PrivateLinkHub, err error) } var _ PrivateLinkHubsClientAPI = (*synapse.PrivateLinkHubsClient)(nil) + +// PrivateEndpointConnectionsPrivateLinkHubClientAPI contains the set of methods on the PrivateEndpointConnectionsPrivateLinkHubClient type. +type PrivateEndpointConnectionsPrivateLinkHubClientAPI interface { + List(ctx context.Context, resourceGroupName string, privateLinkHubName string) (result synapse.PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage, err error) + ListComplete(ctx context.Context, resourceGroupName string, privateLinkHubName string) (result synapse.PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator, err error) +} + +var _ PrivateEndpointConnectionsPrivateLinkHubClientAPI = (*synapse.PrivateEndpointConnectionsPrivateLinkHubClient)(nil) + +// WorkspaceManagedSQLServerBlobAuditingPoliciesClientAPI contains the set of methods on the WorkspaceManagedSQLServerBlobAuditingPoliciesClient type. +type WorkspaceManagedSQLServerBlobAuditingPoliciesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.ServerBlobAuditingPolicy, err error) + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.ServerBlobAuditingPolicyListResultPage, err error) + ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.ServerBlobAuditingPolicyListResultIterator, err error) +} + +var _ WorkspaceManagedSQLServerBlobAuditingPoliciesClientAPI = (*synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesClient)(nil) + +// WorkspaceManagedqlServerBlobAuditingPoliciesClientAPI contains the set of methods on the WorkspaceManagedqlServerBlobAuditingPoliciesClient type. +type WorkspaceManagedqlServerBlobAuditingPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters synapse.ServerBlobAuditingPolicy) (result synapse.WorkspaceManagedqlServerBlobAuditingPoliciesCreateOrUpdateFuture, err error) +} + +var _ WorkspaceManagedqlServerBlobAuditingPoliciesClientAPI = (*synapse.WorkspaceManagedqlServerBlobAuditingPoliciesClient)(nil) + +// WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClientAPI contains the set of methods on the WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient type. +type WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters synapse.ExtendedServerBlobAuditingPolicy) (result synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.ExtendedServerBlobAuditingPolicy, err error) + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.ExtendedServerBlobAuditingPolicyListResultPage, err error) + ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.ExtendedServerBlobAuditingPolicyListResultIterator, err error) +} + +var _ WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClientAPI = (*synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient)(nil) + +// WorkspaceManagedSQLServerSecurityAlertPolicyClientAPI contains the set of methods on the WorkspaceManagedSQLServerSecurityAlertPolicyClient type. +type WorkspaceManagedSQLServerSecurityAlertPolicyClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters synapse.ServerSecurityAlertPolicy) (result synapse.WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.ServerSecurityAlertPolicy, err error) + List(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.ServerSecurityAlertPolicyListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.ServerSecurityAlertPolicyListResultIterator, err error) +} + +var _ WorkspaceManagedSQLServerSecurityAlertPolicyClientAPI = (*synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient)(nil) + +// WorkspaceManagedSQLServerVulnerabilityAssessmentsClientAPI contains the set of methods on the WorkspaceManagedSQLServerVulnerabilityAssessmentsClient type. +type WorkspaceManagedSQLServerVulnerabilityAssessmentsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters synapse.ServerVulnerabilityAssessment) (result synapse.ServerVulnerabilityAssessment, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.ServerVulnerabilityAssessment, err error) + List(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.ServerVulnerabilityAssessmentListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.ServerVulnerabilityAssessmentListResultIterator, err error) +} + +var _ WorkspaceManagedSQLServerVulnerabilityAssessmentsClientAPI = (*synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient)(nil) + +// WorkspaceManagedSQLServerEncryptionProtectorClientAPI contains the set of methods on the WorkspaceManagedSQLServerEncryptionProtectorClient type. +type WorkspaceManagedSQLServerEncryptionProtectorClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters synapse.EncryptionProtector) (result synapse.WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.EncryptionProtector, err error) + List(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.EncryptionProtectorListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.EncryptionProtectorListResultIterator, err error) + Revalidate(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture, err error) +} + +var _ WorkspaceManagedSQLServerEncryptionProtectorClientAPI = (*synapse.WorkspaceManagedSQLServerEncryptionProtectorClient)(nil) + +// WorkspaceManagedSQLServerUsagesClientAPI contains the set of methods on the WorkspaceManagedSQLServerUsagesClient type. +type WorkspaceManagedSQLServerUsagesClientAPI interface { + List(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.ServerUsageListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.ServerUsageListResultIterator, err error) +} + +var _ WorkspaceManagedSQLServerUsagesClientAPI = (*synapse.WorkspaceManagedSQLServerUsagesClient)(nil) + +// WorkspaceManagedSQLServerRecoverableSqlpoolsClientAPI contains the set of methods on the WorkspaceManagedSQLServerRecoverableSqlpoolsClient type. +type WorkspaceManagedSQLServerRecoverableSqlpoolsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLComputeName string) (result synapse.RecoverableSQLPool, err error) + List(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.RecoverableSQLPoolListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.RecoverableSQLPoolListResultIterator, err error) +} + +var _ WorkspaceManagedSQLServerRecoverableSqlpoolsClientAPI = (*synapse.WorkspaceManagedSQLServerRecoverableSqlpoolsClient)(nil) + +// KeysClientAPI contains the set of methods on the KeysClient type. +type KeysClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, keyName string, keyProperties synapse.Key) (result synapse.Key, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, keyName string) (result synapse.Key, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, keyName string) (result synapse.Key, err error) + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.KeyInfoListResultPage, err error) + ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.KeyInfoListResultIterator, err error) +} + +var _ KeysClientAPI = (*synapse.KeysClient)(nil) diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspaceaadadmins.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspaceaadadmins.go index 910564814e84..13814fa8dcd6 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspaceaadadmins.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspaceaadadmins.go @@ -209,7 +209,7 @@ func (client WorkspaceAadAdminsClient) DeleteSender(req *http.Request) (future W func (client WorkspaceAadAdminsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedqlserverblobauditingpolicies.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedqlserverblobauditingpolicies.go new file mode 100644 index 000000000000..57f54d1afa7f --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedqlserverblobauditingpolicies.go @@ -0,0 +1,134 @@ +package synapse + +// 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" +) + +// WorkspaceManagedqlServerBlobAuditingPoliciesClient is the azure Synapse Analytics Management Client +type WorkspaceManagedqlServerBlobAuditingPoliciesClient struct { + BaseClient +} + +// NewWorkspaceManagedqlServerBlobAuditingPoliciesClient creates an instance of the +// WorkspaceManagedqlServerBlobAuditingPoliciesClient client. +func NewWorkspaceManagedqlServerBlobAuditingPoliciesClient(subscriptionID string) WorkspaceManagedqlServerBlobAuditingPoliciesClient { + return NewWorkspaceManagedqlServerBlobAuditingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspaceManagedqlServerBlobAuditingPoliciesClientWithBaseURI creates an instance of the +// WorkspaceManagedqlServerBlobAuditingPoliciesClient 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 NewWorkspaceManagedqlServerBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceManagedqlServerBlobAuditingPoliciesClient { + return WorkspaceManagedqlServerBlobAuditingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or Update a workspace managed sql server's blob auditing policy. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// parameters - properties of extended blob auditing policy. +func (client WorkspaceManagedqlServerBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters ServerBlobAuditingPolicy) (result WorkspaceManagedqlServerBlobAuditingPoliciesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedqlServerBlobAuditingPoliciesClient.CreateOrUpdate") + 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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedqlServerBlobAuditingPoliciesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedqlServerBlobAuditingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedqlServerBlobAuditingPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkspaceManagedqlServerBlobAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters ServerBlobAuditingPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "blobAuditingPolicyName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/auditingSettings/{blobAuditingPolicyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspaceManagedqlServerBlobAuditingPoliciesClient) CreateOrUpdateSender(req *http.Request) (future WorkspaceManagedqlServerBlobAuditingPoliciesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedqlServerBlobAuditingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServerBlobAuditingPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverblobauditingpolicies.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverblobauditingpolicies.go new file mode 100644 index 000000000000..939cededd7bb --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverblobauditingpolicies.go @@ -0,0 +1,257 @@ +package synapse + +// 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" +) + +// WorkspaceManagedSQLServerBlobAuditingPoliciesClient is the azure Synapse Analytics Management Client +type WorkspaceManagedSQLServerBlobAuditingPoliciesClient struct { + BaseClient +} + +// NewWorkspaceManagedSQLServerBlobAuditingPoliciesClient creates an instance of the +// WorkspaceManagedSQLServerBlobAuditingPoliciesClient client. +func NewWorkspaceManagedSQLServerBlobAuditingPoliciesClient(subscriptionID string) WorkspaceManagedSQLServerBlobAuditingPoliciesClient { + return NewWorkspaceManagedSQLServerBlobAuditingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspaceManagedSQLServerBlobAuditingPoliciesClientWithBaseURI creates an instance of the +// WorkspaceManagedSQLServerBlobAuditingPoliciesClient 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 NewWorkspaceManagedSQLServerBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceManagedSQLServerBlobAuditingPoliciesClient { + return WorkspaceManagedSQLServerBlobAuditingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get a workspace managed sql server's blob auditing policy. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceManagedSQLServerBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result ServerBlobAuditingPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerBlobAuditingPoliciesClient.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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspaceManagedSQLServerBlobAuditingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "blobAuditingPolicyName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/auditingSettings/{blobAuditingPolicyName}", 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 WorkspaceManagedSQLServerBlobAuditingPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerBlobAuditingPoliciesClient) GetResponder(resp *http.Response) (result ServerBlobAuditingPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace list workspace managed sql server's blob auditing policies. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceManagedSQLServerBlobAuditingPoliciesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result ServerBlobAuditingPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerBlobAuditingPoliciesClient.ListByWorkspace") + defer func() { + sc := -1 + if result.sbaplr.Response.Response != nil { + sc = result.sbaplr.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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesClient", "ListByWorkspace", err.Error()) + } + + result.fn = client.listByWorkspaceNextResults + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.sbaplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result.sbaplr, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesClient", "ListByWorkspace", resp, "Failure responding to request") + } + if result.sbaplr.hasNextLink() && result.sbaplr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client WorkspaceManagedSQLServerBlobAuditingPoliciesClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/auditingSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspaceManagedSQLServerBlobAuditingPoliciesClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerBlobAuditingPoliciesClient) ListByWorkspaceResponder(resp *http.Response) (result ServerBlobAuditingPolicyListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByWorkspaceNextResults retrieves the next set of results, if any. +func (client WorkspaceManagedSQLServerBlobAuditingPoliciesClient) listByWorkspaceNextResults(ctx context.Context, lastResults ServerBlobAuditingPolicyListResult) (result ServerBlobAuditingPolicyListResult, err error) { + req, err := lastResults.serverBlobAuditingPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesClient", "listByWorkspaceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesClient", "listByWorkspaceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesClient", "listByWorkspaceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByWorkspaceComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspaceManagedSQLServerBlobAuditingPoliciesClient) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result ServerBlobAuditingPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerBlobAuditingPoliciesClient.ListByWorkspace") + 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.ListByWorkspace(ctx, resourceGroupName, workspaceName) + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverencryptionprotector.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverencryptionprotector.go new file mode 100644 index 000000000000..fa81a3147fde --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverencryptionprotector.go @@ -0,0 +1,433 @@ +package synapse + +// 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" +) + +// WorkspaceManagedSQLServerEncryptionProtectorClient is the azure Synapse Analytics Management Client +type WorkspaceManagedSQLServerEncryptionProtectorClient struct { + BaseClient +} + +// NewWorkspaceManagedSQLServerEncryptionProtectorClient creates an instance of the +// WorkspaceManagedSQLServerEncryptionProtectorClient client. +func NewWorkspaceManagedSQLServerEncryptionProtectorClient(subscriptionID string) WorkspaceManagedSQLServerEncryptionProtectorClient { + return NewWorkspaceManagedSQLServerEncryptionProtectorClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspaceManagedSQLServerEncryptionProtectorClientWithBaseURI creates an instance of the +// WorkspaceManagedSQLServerEncryptionProtectorClient 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 NewWorkspaceManagedSQLServerEncryptionProtectorClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceManagedSQLServerEncryptionProtectorClient { + return WorkspaceManagedSQLServerEncryptionProtectorClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate updates workspace managed sql server's encryption protector. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// parameters - the requested encryption protector resource state. +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters EncryptionProtector) (result WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerEncryptionProtectorClient.CreateOrUpdate") + 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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters EncryptionProtector) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "encryptionProtectorName": autorest.Encode("path", "current"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.Kind = nil + parameters.Location = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/encryptionProtector/{encryptionProtectorName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) CreateOrUpdateSender(req *http.Request) (future WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) CreateOrUpdateResponder(resp *http.Response) (result EncryptionProtector, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get workspace managed sql server's encryption protector. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result EncryptionProtector, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerEncryptionProtectorClient.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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "encryptionProtectorName": autorest.Encode("path", "current"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/encryptionProtector/{encryptionProtectorName}", 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 WorkspaceManagedSQLServerEncryptionProtectorClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) GetResponder(resp *http.Response) (result EncryptionProtector, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List get list of encryption protectors for workspace managed sql server. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result EncryptionProtectorListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerEncryptionProtectorClient.List") + defer func() { + sc := -1 + if result.eplr.Response.Response != nil { + sc = result.eplr.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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.eplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "List", resp, "Failure sending request") + return + } + + result.eplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "List", resp, "Failure responding to request") + } + if result.eplr.hasNextLink() && result.eplr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/encryptionProtector", 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 WorkspaceManagedSQLServerEncryptionProtectorClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) ListResponder(resp *http.Response) (result EncryptionProtectorListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) listNextResults(ctx context.Context, lastResults EncryptionProtectorListResult) (result EncryptionProtectorListResult, err error) { + req, err := lastResults.encryptionProtectorListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "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, "synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result EncryptionProtectorListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerEncryptionProtectorClient.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, resourceGroupName, workspaceName) + return +} + +// Revalidate revalidates workspace managed sql server's existing encryption protector. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) Revalidate(ctx context.Context, resourceGroupName string, workspaceName string) (result WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerEncryptionProtectorClient.Revalidate") + 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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "Revalidate", err.Error()) + } + + req, err := client.RevalidatePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "Revalidate", nil, "Failure preparing request") + return + } + + result, err = client.RevalidateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorClient", "Revalidate", result.Response(), "Failure sending request") + return + } + + return +} + +// RevalidatePreparer prepares the Revalidate request. +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) RevalidatePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "encryptionProtectorName": autorest.Encode("path", "current"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/encryptionProtector/{encryptionProtectorName}/revalidate", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RevalidateSender sends the Revalidate request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) RevalidateSender(req *http.Request) (future WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// RevalidateResponder handles the response to the Revalidate request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerEncryptionProtectorClient) RevalidateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverextendedblobauditingpolicies.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverextendedblobauditingpolicies.go new file mode 100644 index 000000000000..692933c2f381 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverextendedblobauditingpolicies.go @@ -0,0 +1,346 @@ +package synapse + +// 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" +) + +// WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient is the azure Synapse Analytics Management Client +type WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient struct { + BaseClient +} + +// NewWorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient creates an instance of the +// WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient client. +func NewWorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient(subscriptionID string) WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient { + return NewWorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClientWithBaseURI creates an instance of the +// WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient 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 NewWorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient { + return WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or Update a workspace managed sql server's extended blob auditing policy. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// parameters - properties of extended blob auditing policy. +func (client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters ExtendedServerBlobAuditingPolicy) (result WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient.CreateOrUpdate") + 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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters ExtendedServerBlobAuditingPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "blobAuditingPolicyName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/extendedAuditingSettings/{blobAuditingPolicyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) CreateOrUpdateSender(req *http.Request) (future WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ExtendedServerBlobAuditingPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get a workspace SQL server's extended blob auditing policy. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result ExtendedServerBlobAuditingPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient.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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "blobAuditingPolicyName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/extendedAuditingSettings/{blobAuditingPolicyName}", 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 WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) GetResponder(resp *http.Response) (result ExtendedServerBlobAuditingPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace list workspace managed sql server's extended blob auditing policies. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result ExtendedServerBlobAuditingPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient.ListByWorkspace") + defer func() { + sc := -1 + if result.esbaplr.Response.Response != nil { + sc = result.esbaplr.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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient", "ListByWorkspace", err.Error()) + } + + result.fn = client.listByWorkspaceNextResults + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.esbaplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result.esbaplr, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient", "ListByWorkspace", resp, "Failure responding to request") + } + if result.esbaplr.hasNextLink() && result.esbaplr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/extendedAuditingSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) ListByWorkspaceResponder(resp *http.Response) (result ExtendedServerBlobAuditingPolicyListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByWorkspaceNextResults retrieves the next set of results, if any. +func (client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) listByWorkspaceNextResults(ctx context.Context, lastResults ExtendedServerBlobAuditingPolicyListResult) (result ExtendedServerBlobAuditingPolicyListResult, err error) { + req, err := lastResults.extendedServerBlobAuditingPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient", "listByWorkspaceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient", "listByWorkspaceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient", "listByWorkspaceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByWorkspaceComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result ExtendedServerBlobAuditingPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient.ListByWorkspace") + 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.ListByWorkspace(ctx, resourceGroupName, workspaceName) + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverrecoverablesqlpools.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverrecoverablesqlpools.go new file mode 100644 index 000000000000..c3383c5cc6f3 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverrecoverablesqlpools.go @@ -0,0 +1,258 @@ +package synapse + +// 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" +) + +// WorkspaceManagedSQLServerRecoverableSqlpoolsClient is the azure Synapse Analytics Management Client +type WorkspaceManagedSQLServerRecoverableSqlpoolsClient struct { + BaseClient +} + +// NewWorkspaceManagedSQLServerRecoverableSqlpoolsClient creates an instance of the +// WorkspaceManagedSQLServerRecoverableSqlpoolsClient client. +func NewWorkspaceManagedSQLServerRecoverableSqlpoolsClient(subscriptionID string) WorkspaceManagedSQLServerRecoverableSqlpoolsClient { + return NewWorkspaceManagedSQLServerRecoverableSqlpoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspaceManagedSQLServerRecoverableSqlpoolsClientWithBaseURI creates an instance of the +// WorkspaceManagedSQLServerRecoverableSqlpoolsClient 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 NewWorkspaceManagedSQLServerRecoverableSqlpoolsClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceManagedSQLServerRecoverableSqlpoolsClient { + return WorkspaceManagedSQLServerRecoverableSqlpoolsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get recoverable sql pools for workspace managed sql server. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// SQLComputeName - the name of the sql compute +func (client WorkspaceManagedSQLServerRecoverableSqlpoolsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, SQLComputeName string) (result RecoverableSQLPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerRecoverableSqlpoolsClient.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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerRecoverableSqlpoolsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, SQLComputeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerRecoverableSqlpoolsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerRecoverableSqlpoolsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerRecoverableSqlpoolsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspaceManagedSQLServerRecoverableSqlpoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLComputeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlComputeName": autorest.Encode("path", SQLComputeName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/recoverableSqlPools/{sqlComputeName}", 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 WorkspaceManagedSQLServerRecoverableSqlpoolsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerRecoverableSqlpoolsClient) GetResponder(resp *http.Response) (result RecoverableSQLPool, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List get list of recoverable sql pools for workspace managed sql server. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceManagedSQLServerRecoverableSqlpoolsClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result RecoverableSQLPoolListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerRecoverableSqlpoolsClient.List") + defer func() { + sc := -1 + if result.rsplr.Response.Response != nil { + sc = result.rsplr.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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerRecoverableSqlpoolsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerRecoverableSqlpoolsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rsplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerRecoverableSqlpoolsClient", "List", resp, "Failure sending request") + return + } + + result.rsplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerRecoverableSqlpoolsClient", "List", resp, "Failure responding to request") + } + if result.rsplr.hasNextLink() && result.rsplr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkspaceManagedSQLServerRecoverableSqlpoolsClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/recoverableSqlpools", 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 WorkspaceManagedSQLServerRecoverableSqlpoolsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerRecoverableSqlpoolsClient) ListResponder(resp *http.Response) (result RecoverableSQLPoolListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client WorkspaceManagedSQLServerRecoverableSqlpoolsClient) listNextResults(ctx context.Context, lastResults RecoverableSQLPoolListResult) (result RecoverableSQLPoolListResult, err error) { + req, err := lastResults.recoverableSQLPoolListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerRecoverableSqlpoolsClient", "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, "synapse.WorkspaceManagedSQLServerRecoverableSqlpoolsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerRecoverableSqlpoolsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspaceManagedSQLServerRecoverableSqlpoolsClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result RecoverableSQLPoolListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerRecoverableSqlpoolsClient.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, resourceGroupName, workspaceName) + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserversecurityalertpolicy.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserversecurityalertpolicy.go new file mode 100644 index 000000000000..c29779c5a070 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserversecurityalertpolicy.go @@ -0,0 +1,346 @@ +package synapse + +// 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" +) + +// WorkspaceManagedSQLServerSecurityAlertPolicyClient is the azure Synapse Analytics Management Client +type WorkspaceManagedSQLServerSecurityAlertPolicyClient struct { + BaseClient +} + +// NewWorkspaceManagedSQLServerSecurityAlertPolicyClient creates an instance of the +// WorkspaceManagedSQLServerSecurityAlertPolicyClient client. +func NewWorkspaceManagedSQLServerSecurityAlertPolicyClient(subscriptionID string) WorkspaceManagedSQLServerSecurityAlertPolicyClient { + return NewWorkspaceManagedSQLServerSecurityAlertPolicyClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspaceManagedSQLServerSecurityAlertPolicyClientWithBaseURI creates an instance of the +// WorkspaceManagedSQLServerSecurityAlertPolicyClient 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 NewWorkspaceManagedSQLServerSecurityAlertPolicyClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceManagedSQLServerSecurityAlertPolicyClient { + return WorkspaceManagedSQLServerSecurityAlertPolicyClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or Update a workspace managed sql server's threat detection policy. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// parameters - the workspace managed sql server security alert policy. +func (client WorkspaceManagedSQLServerSecurityAlertPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters ServerSecurityAlertPolicy) (result WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerSecurityAlertPolicyClient.CreateOrUpdate") + 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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkspaceManagedSQLServerSecurityAlertPolicyClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters ServerSecurityAlertPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityAlertPolicyName": autorest.Encode("path", "Default"), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/securityAlertPolicies/{securityAlertPolicyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspaceManagedSQLServerSecurityAlertPolicyClient) CreateOrUpdateSender(req *http.Request) (future WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerSecurityAlertPolicyClient) CreateOrUpdateResponder(resp *http.Response) (result ServerSecurityAlertPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get a workspace managed sql server's security alert policy. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceManagedSQLServerSecurityAlertPolicyClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result ServerSecurityAlertPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerSecurityAlertPolicyClient.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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspaceManagedSQLServerSecurityAlertPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityAlertPolicyName": autorest.Encode("path", "Default"), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/securityAlertPolicies/{securityAlertPolicyName}", 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 WorkspaceManagedSQLServerSecurityAlertPolicyClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerSecurityAlertPolicyClient) GetResponder(resp *http.Response) (result ServerSecurityAlertPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List get workspace managed sql server's threat detection policies. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceManagedSQLServerSecurityAlertPolicyClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result ServerSecurityAlertPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerSecurityAlertPolicyClient.List") + defer func() { + sc := -1 + if result.ssaplr.Response.Response != nil { + sc = result.ssaplr.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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ssaplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient", "List", resp, "Failure sending request") + return + } + + result.ssaplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient", "List", resp, "Failure responding to request") + } + if result.ssaplr.hasNextLink() && result.ssaplr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkspaceManagedSQLServerSecurityAlertPolicyClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/securityAlertPolicies", 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 WorkspaceManagedSQLServerSecurityAlertPolicyClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerSecurityAlertPolicyClient) ListResponder(resp *http.Response) (result ServerSecurityAlertPolicyListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client WorkspaceManagedSQLServerSecurityAlertPolicyClient) listNextResults(ctx context.Context, lastResults ServerSecurityAlertPolicyListResult) (result ServerSecurityAlertPolicyListResult, err error) { + req, err := lastResults.serverSecurityAlertPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient", "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, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspaceManagedSQLServerSecurityAlertPolicyClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result ServerSecurityAlertPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerSecurityAlertPolicyClient.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, resourceGroupName, workspaceName) + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverusages.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverusages.go new file mode 100644 index 000000000000..3a676c756729 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlserverusages.go @@ -0,0 +1,170 @@ +package synapse + +// 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" +) + +// WorkspaceManagedSQLServerUsagesClient is the azure Synapse Analytics Management Client +type WorkspaceManagedSQLServerUsagesClient struct { + BaseClient +} + +// NewWorkspaceManagedSQLServerUsagesClient creates an instance of the WorkspaceManagedSQLServerUsagesClient client. +func NewWorkspaceManagedSQLServerUsagesClient(subscriptionID string) WorkspaceManagedSQLServerUsagesClient { + return NewWorkspaceManagedSQLServerUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspaceManagedSQLServerUsagesClientWithBaseURI creates an instance of the WorkspaceManagedSQLServerUsagesClient +// 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 NewWorkspaceManagedSQLServerUsagesClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceManagedSQLServerUsagesClient { + return WorkspaceManagedSQLServerUsagesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List get list of server usages metric for workspace managed sql server. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceManagedSQLServerUsagesClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result ServerUsageListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerUsagesClient.List") + defer func() { + sc := -1 + if result.sulr.Response.Response != nil { + sc = result.sulr.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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerUsagesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerUsagesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sulr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerUsagesClient", "List", resp, "Failure sending request") + return + } + + result.sulr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerUsagesClient", "List", resp, "Failure responding to request") + } + if result.sulr.hasNextLink() && result.sulr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkspaceManagedSQLServerUsagesClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlUsages", 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 WorkspaceManagedSQLServerUsagesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerUsagesClient) ListResponder(resp *http.Response) (result ServerUsageListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client WorkspaceManagedSQLServerUsagesClient) listNextResults(ctx context.Context, lastResults ServerUsageListResult) (result ServerUsageListResult, err error) { + req, err := lastResults.serverUsageListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerUsagesClient", "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, "synapse.WorkspaceManagedSQLServerUsagesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerUsagesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspaceManagedSQLServerUsagesClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result ServerUsageListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerUsagesClient.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, resourceGroupName, workspaceName) + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlservervulnerabilityassessments.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlservervulnerabilityassessments.go new file mode 100644 index 000000000000..7be58799337a --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedsqlservervulnerabilityassessments.go @@ -0,0 +1,434 @@ +package synapse + +// 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" +) + +// WorkspaceManagedSQLServerVulnerabilityAssessmentsClient is the azure Synapse Analytics Management Client +type WorkspaceManagedSQLServerVulnerabilityAssessmentsClient struct { + BaseClient +} + +// NewWorkspaceManagedSQLServerVulnerabilityAssessmentsClient creates an instance of the +// WorkspaceManagedSQLServerVulnerabilityAssessmentsClient client. +func NewWorkspaceManagedSQLServerVulnerabilityAssessmentsClient(subscriptionID string) WorkspaceManagedSQLServerVulnerabilityAssessmentsClient { + return NewWorkspaceManagedSQLServerVulnerabilityAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspaceManagedSQLServerVulnerabilityAssessmentsClientWithBaseURI creates an instance of the +// WorkspaceManagedSQLServerVulnerabilityAssessmentsClient 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 NewWorkspaceManagedSQLServerVulnerabilityAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceManagedSQLServerVulnerabilityAssessmentsClient { + return WorkspaceManagedSQLServerVulnerabilityAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or Update workspace managed sql server's vulnerability assessment. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// parameters - properties for vulnerability assessment. +func (client WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters ServerVulnerabilityAssessment) (result ServerVulnerabilityAssessment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerVulnerabilityAssessmentsClient.CreateOrUpdate") + 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.MinLength, Rule: 1, 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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ServerVulnerabilityAssessmentProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ServerVulnerabilityAssessmentProperties.StorageContainerPath", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters ServerVulnerabilityAssessment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vulnerabilityAssessmentName": autorest.Encode("path", "default"), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) CreateOrUpdateResponder(resp *http.Response) (result ServerVulnerabilityAssessment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete remove workspace managed sql server's vulnerability assessment. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerVulnerabilityAssessmentsClient.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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vulnerabilityAssessmentName": autorest.Encode("path", "default"), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", 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 WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) 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 WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get workspace managed sql server's vulnerability assessment. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result ServerVulnerabilityAssessment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerVulnerabilityAssessmentsClient.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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vulnerabilityAssessmentName": autorest.Encode("path", "default"), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", 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 WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) GetResponder(resp *http.Response) (result ServerVulnerabilityAssessment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the vulnerability assessment policies associated with a workspace managed sql server. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result ServerVulnerabilityAssessmentListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerVulnerabilityAssessmentsClient.List") + defer func() { + sc := -1 + if result.svalr.Response.Response != nil { + sc = result.svalr.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.MinLength, Rule: 1, 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("synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.svalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "List", resp, "Failure sending request") + return + } + + result.svalr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "List", resp, "Failure responding to request") + } + if result.svalr.hasNextLink() && result.svalr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/vulnerabilityAssessments", 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 WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) ListResponder(resp *http.Response) (result ServerVulnerabilityAssessmentListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) listNextResults(ctx context.Context, lastResults ServerVulnerabilityAssessmentListResult) (result ServerVulnerabilityAssessmentListResult, err error) { + req, err := lastResults.serverVulnerabilityAssessmentListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "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, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerVulnerabilityAssessmentsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspaceManagedSQLServerVulnerabilityAssessmentsClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result ServerVulnerabilityAssessmentListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceManagedSQLServerVulnerabilityAssessmentsClient.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, resourceGroupName, workspaceName) + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacesqlaadadmins.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacesqlaadadmins.go new file mode 100644 index 000000000000..9fbd2482229e --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacesqlaadadmins.go @@ -0,0 +1,301 @@ +package synapse + +// 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" +) + +// WorkspaceSQLAadAdminsClient is the azure Synapse Analytics Management Client +type WorkspaceSQLAadAdminsClient struct { + BaseClient +} + +// NewWorkspaceSQLAadAdminsClient creates an instance of the WorkspaceSQLAadAdminsClient client. +func NewWorkspaceSQLAadAdminsClient(subscriptionID string) WorkspaceSQLAadAdminsClient { + return NewWorkspaceSQLAadAdminsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspaceSQLAadAdminsClientWithBaseURI creates an instance of the WorkspaceSQLAadAdminsClient 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 NewWorkspaceSQLAadAdminsClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceSQLAadAdminsClient { + return WorkspaceSQLAadAdminsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a workspace SQL active directory admin +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// aadAdminInfo - workspace active directory administrator properties +func (client WorkspaceSQLAadAdminsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, aadAdminInfo WorkspaceAadAdminInfo) (result WorkspaceSQLAadAdminsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceSQLAadAdminsClient.CreateOrUpdate") + 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.MinLength, Rule: 1, 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("synapse.WorkspaceSQLAadAdminsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, aadAdminInfo) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceSQLAadAdminsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceSQLAadAdminsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkspaceSQLAadAdminsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, aadAdminInfo WorkspaceAadAdminInfo) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlAdministrators/activeDirectory", pathParameters), + autorest.WithJSON(aadAdminInfo), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspaceSQLAadAdminsClient) CreateOrUpdateSender(req *http.Request) (future WorkspaceSQLAadAdminsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WorkspaceSQLAadAdminsClient) CreateOrUpdateResponder(resp *http.Response) (result WorkspaceAadAdminInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a workspace SQL active directory admin +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceSQLAadAdminsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result WorkspaceSQLAadAdminsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceSQLAadAdminsClient.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.MinLength, Rule: 1, 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("synapse.WorkspaceSQLAadAdminsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceSQLAadAdminsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceSQLAadAdminsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WorkspaceSQLAadAdminsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlAdministrators/activeDirectory", 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 WorkspaceSQLAadAdminsClient) DeleteSender(req *http.Request) (future WorkspaceSQLAadAdminsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client WorkspaceSQLAadAdminsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a workspace SQL active directory admin +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspaceSQLAadAdminsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result WorkspaceAadAdminInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceSQLAadAdminsClient.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.MinLength, Rule: 1, 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("synapse.WorkspaceSQLAadAdminsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceSQLAadAdminsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.WorkspaceSQLAadAdminsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.WorkspaceSQLAadAdminsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspaceSQLAadAdminsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-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/Microsoft.Synapse/workspaces/{workspaceName}/sqlAdministrators/activeDirectory", 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 WorkspaceSQLAadAdminsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkspaceSQLAadAdminsClient) GetResponder(resp *http.Response) (result WorkspaceAadAdminInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +}