From 05a30398d4eb4be7ab298a4336a96c3499b6202c Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 23 Jul 2020 07:46:19 +0000 Subject: [PATCH] Generated from 4ef20531335ab6f9a32dbbd0283f26f0c79a4192 Updated Managed resource group to be non-readonly Updated Managed resource group to be non-readonly --- .../synapse/bigdatapools.go | 14 +- .../synapse/integrationruntimeauthkeys.go | 221 + .../integrationruntimeconnectioninfos.go | 132 + .../synapse/integrationruntimecredentials.go | 133 + .../integrationruntimemonitoringdata.go | 131 + .../integrationruntimenodeipaddress.go | 133 + .../synapse/integrationruntimenodes.go | 313 + .../integrationruntimeobjectmetadata.go | 224 + .../synapse/integrationruntimes.go | 793 +++ .../synapse/integrationruntimestatus.go | 131 + .../synapse/ipfirewallrules.go | 91 +- .../mgmt/2019-06-01-preview/synapse/models.go | 5371 +++++++++++++++-- .../2019-06-01-preview/synapse/operations.go | 4 - .../synapse/privateendpointconnections.go | 428 ++ .../synapse/privatelinkhubs.go | 623 ++ .../synapse/privatelinkresources.go | 254 + .../synapse/sqlpoolblobauditingpolicies.go | 2 - .../synapse/sqlpoolconnectionpolicies.go | 1 - .../sqlpooldatawarehouseuseractivities.go | 1 - .../synapse/sqlpoolgeobackuppolicies.go | 1 - .../synapse/sqlpoolmetadatasyncconfigs.go | 2 - .../synapse/sqlpooloperationresults.go | 1 - .../synapse/sqlpooloperations.go | 1 - .../synapse/sqlpoolreplicationlinks.go | 1 - .../synapse/sqlpoolrestorepoints.go | 2 - .../2019-06-01-preview/synapse/sqlpools.go | 10 +- .../synapse/sqlpoolschemas.go | 1 - .../synapse/sqlpoolsecurityalertpolicies.go | 2 - .../synapse/sqlpoolsensitivitylabels.go | 6 - .../synapse/sqlpooltablecolumns.go | 1 - .../synapse/sqlpooltables.go | 1 - .../sqlpooltransparentdataencryptions.go | 2 - .../synapse/sqlpoolusages.go | 1 - ...oolvulnerabilityassessmentrulebaselines.go | 2 - .../sqlpoolvulnerabilityassessments.go | 4 - .../sqlpoolvulnerabilityassessmentscans.go | 3 - .../synapse/synapseapi/interfaces.go | 110 + .../2019-06-01-preview/synapse/version.go | 2 +- .../synapse/workspaceaadadmins.go | 3 - ...kspacemanagedidentitysqlcontrolsettings.go | 2 - .../2019-06-01-preview/synapse/workspaces.go | 6 - 41 files changed, 8639 insertions(+), 525 deletions(-) create mode 100644 services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimeauthkeys.go create mode 100644 services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimeconnectioninfos.go create mode 100644 services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimecredentials.go create mode 100644 services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimemonitoringdata.go create mode 100644 services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimenodeipaddress.go create mode 100644 services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimenodes.go create mode 100644 services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimeobjectmetadata.go create mode 100644 services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimes.go create mode 100644 services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimestatus.go create mode 100644 services/preview/synapse/mgmt/2019-06-01-preview/synapse/privateendpointconnections.go create mode 100644 services/preview/synapse/mgmt/2019-06-01-preview/synapse/privatelinkhubs.go create mode 100644 services/preview/synapse/mgmt/2019-06-01-preview/synapse/privatelinkresources.go diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/bigdatapools.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/bigdatapools.go index 158b918a49c4..70175b40342c 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/bigdatapools.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/bigdatapools.go @@ -66,14 +66,7 @@ func (client BigDataPoolsClient) CreateOrUpdate(ctx context.Context, resourceGro {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: bigDataPoolInfo, - Constraints: []validation.Constraint{{Target: "bigDataPoolInfo.BigDataPoolResourceProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "bigDataPoolInfo.BigDataPoolResourceProperties.NodeCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "bigDataPoolInfo.BigDataPoolResourceProperties.NodeCount", Name: validation.InclusiveMaximum, Rule: int64(200), Chain: nil}, - {Target: "bigDataPoolInfo.BigDataPoolResourceProperties.NodeCount", Name: validation.InclusiveMinimum, Rule: int64(3), Chain: nil}, - }}, - }}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("synapse.BigDataPoolsClient", "CreateOrUpdate", err.Error()) } @@ -138,7 +131,6 @@ func (client BigDataPoolsClient) CreateOrUpdateSender(req *http.Request) (future func (client BigDataPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result BigDataPoolResourceInfo, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -226,7 +218,6 @@ func (client BigDataPoolsClient) DeleteSender(req *http.Request) (future BigData func (client BigDataPoolsClient) DeleteResponder(resp *http.Response) (result SetObject, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -314,7 +305,6 @@ func (client BigDataPoolsClient) GetSender(req *http.Request) (*http.Response, e func (client BigDataPoolsClient) GetResponder(resp *http.Response) (result BigDataPoolResourceInfo, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -401,7 +391,6 @@ func (client BigDataPoolsClient) ListByWorkspaceSender(req *http.Request) (*http func (client BigDataPoolsClient) ListByWorkspaceResponder(resp *http.Response) (result BigDataPoolResourceInfoListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -529,7 +518,6 @@ func (client BigDataPoolsClient) UpdateSender(req *http.Request) (*http.Response func (client BigDataPoolsClient) UpdateResponder(resp *http.Response) (result BigDataPoolResourceInfo, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimeauthkeys.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimeauthkeys.go new file mode 100644 index 000000000000..751daffdeae5 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimeauthkeys.go @@ -0,0 +1,221 @@ +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" +) + +// IntegrationRuntimeAuthKeysClient is the azure Synapse Analytics Management Client +type IntegrationRuntimeAuthKeysClient struct { + BaseClient +} + +// NewIntegrationRuntimeAuthKeysClient creates an instance of the IntegrationRuntimeAuthKeysClient client. +func NewIntegrationRuntimeAuthKeysClient(subscriptionID string) IntegrationRuntimeAuthKeysClient { + return NewIntegrationRuntimeAuthKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationRuntimeAuthKeysClientWithBaseURI creates an instance of the IntegrationRuntimeAuthKeysClient 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 NewIntegrationRuntimeAuthKeysClientWithBaseURI(baseURI string, subscriptionID string) IntegrationRuntimeAuthKeysClient { + return IntegrationRuntimeAuthKeysClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List list authentication keys in 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 IntegrationRuntimeAuthKeysClient) List(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result IntegrationRuntimeAuthKeys, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeAuthKeysClient.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.IntegrationRuntimeAuthKeysClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeAuthKeysClient", "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.IntegrationRuntimeAuthKeysClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeAuthKeysClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IntegrationRuntimeAuthKeysClient) 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), + "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}/listAuthKeys", 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 IntegrationRuntimeAuthKeysClient) 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 IntegrationRuntimeAuthKeysClient) ListResponder(resp *http.Response) (result IntegrationRuntimeAuthKeys, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Regenerate regenerate the authentication key 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 +// regenerateKeyParameters - the parameters for regenerating integration runtime authentication key. +func (client IntegrationRuntimeAuthKeysClient) Regenerate(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, regenerateKeyParameters IntegrationRuntimeRegenerateKeyParameters) (result IntegrationRuntimeAuthKeys, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeAuthKeysClient.Regenerate") + 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.IntegrationRuntimeAuthKeysClient", "Regenerate", err.Error()) + } + + req, err := client.RegeneratePreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName, regenerateKeyParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeAuthKeysClient", "Regenerate", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeAuthKeysClient", "Regenerate", resp, "Failure sending request") + return + } + + result, err = client.RegenerateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeAuthKeysClient", "Regenerate", resp, "Failure responding to request") + } + + return +} + +// RegeneratePreparer prepares the Regenerate request. +func (client IntegrationRuntimeAuthKeysClient) RegeneratePreparer(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, regenerateKeyParameters IntegrationRuntimeRegenerateKeyParameters) (*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.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/regenerateAuthKey", pathParameters), + autorest.WithJSON(regenerateKeyParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateSender sends the Regenerate request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimeAuthKeysClient) RegenerateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateResponder handles the response to the Regenerate request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimeAuthKeysClient) RegenerateResponder(resp *http.Response) (result IntegrationRuntimeAuthKeys, 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/integrationruntimeconnectioninfos.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimeconnectioninfos.go new file mode 100644 index 000000000000..a5e5e56dac44 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimeconnectioninfos.go @@ -0,0 +1,132 @@ +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" +) + +// IntegrationRuntimeConnectionInfosClient is the azure Synapse Analytics Management Client +type IntegrationRuntimeConnectionInfosClient struct { + BaseClient +} + +// NewIntegrationRuntimeConnectionInfosClient creates an instance of the IntegrationRuntimeConnectionInfosClient +// client. +func NewIntegrationRuntimeConnectionInfosClient(subscriptionID string) IntegrationRuntimeConnectionInfosClient { + return NewIntegrationRuntimeConnectionInfosClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationRuntimeConnectionInfosClientWithBaseURI creates an instance of the +// IntegrationRuntimeConnectionInfosClient 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 NewIntegrationRuntimeConnectionInfosClientWithBaseURI(baseURI string, subscriptionID string) IntegrationRuntimeConnectionInfosClient { + return IntegrationRuntimeConnectionInfosClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get connection info 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 IntegrationRuntimeConnectionInfosClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result IntegrationRuntimeConnectionInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeConnectionInfosClient.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.IntegrationRuntimeConnectionInfosClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeConnectionInfosClient", "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.IntegrationRuntimeConnectionInfosClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeConnectionInfosClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationRuntimeConnectionInfosClient) GetPreparer(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}/getConnectionInfo", 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 IntegrationRuntimeConnectionInfosClient) 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 IntegrationRuntimeConnectionInfosClient) GetResponder(resp *http.Response) (result IntegrationRuntimeConnectionInfo, 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/integrationruntimecredentials.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimecredentials.go new file mode 100644 index 000000000000..f48fbaaaaec1 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimecredentials.go @@ -0,0 +1,133 @@ +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" +) + +// IntegrationRuntimeCredentialsClient is the azure Synapse Analytics Management Client +type IntegrationRuntimeCredentialsClient struct { + BaseClient +} + +// NewIntegrationRuntimeCredentialsClient creates an instance of the IntegrationRuntimeCredentialsClient client. +func NewIntegrationRuntimeCredentialsClient(subscriptionID string) IntegrationRuntimeCredentialsClient { + return NewIntegrationRuntimeCredentialsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationRuntimeCredentialsClientWithBaseURI creates an instance of the IntegrationRuntimeCredentialsClient +// 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 NewIntegrationRuntimeCredentialsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationRuntimeCredentialsClient { + return IntegrationRuntimeCredentialsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Sync force the integration runtime to synchronize credentials across integration runtime nodes, and this will +// override the credentials across all worker nodes with those available on the dispatcher node. If you already have +// the latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime +// node than using this API directly. +// 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 IntegrationRuntimeCredentialsClient) Sync(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeCredentialsClient.Sync") + 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.IntegrationRuntimeCredentialsClient", "Sync", err.Error()) + } + + req, err := client.SyncPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeCredentialsClient", "Sync", nil, "Failure preparing request") + return + } + + resp, err := client.SyncSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeCredentialsClient", "Sync", resp, "Failure sending request") + return + } + + result, err = client.SyncResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeCredentialsClient", "Sync", resp, "Failure responding to request") + } + + return +} + +// SyncPreparer prepares the Sync request. +func (client IntegrationRuntimeCredentialsClient) SyncPreparer(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}/syncCredentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SyncSender sends the Sync request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimeCredentialsClient) SyncSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SyncResponder handles the response to the Sync request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimeCredentialsClient) SyncResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + 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 new file mode 100644 index 000000000000..9cc9e188c904 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimemonitoringdata.go @@ -0,0 +1,131 @@ +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" +) + +// IntegrationRuntimeMonitoringDataClient is the azure Synapse Analytics Management Client +type IntegrationRuntimeMonitoringDataClient struct { + BaseClient +} + +// NewIntegrationRuntimeMonitoringDataClient creates an instance of the IntegrationRuntimeMonitoringDataClient client. +func NewIntegrationRuntimeMonitoringDataClient(subscriptionID string) IntegrationRuntimeMonitoringDataClient { + return NewIntegrationRuntimeMonitoringDataClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationRuntimeMonitoringDataClientWithBaseURI creates an instance of the +// IntegrationRuntimeMonitoringDataClient 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 NewIntegrationRuntimeMonitoringDataClientWithBaseURI(baseURI string, subscriptionID string) IntegrationRuntimeMonitoringDataClient { + return IntegrationRuntimeMonitoringDataClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeMonitoringDataClient.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.IntegrationRuntimeMonitoringDataClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeMonitoringDataClient", "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.IntegrationRuntimeMonitoringDataClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeMonitoringDataClient", "Get", 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) { + 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}/monitoringData", 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 IntegrationRuntimeMonitoringDataClient) 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 IntegrationRuntimeMonitoringDataClient) GetResponder(resp *http.Response) (result IntegrationRuntimeMonitoringData, 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/integrationruntimenodeipaddress.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimenodeipaddress.go new file mode 100644 index 000000000000..756b9824e869 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimenodeipaddress.go @@ -0,0 +1,133 @@ +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" +) + +// IntegrationRuntimeNodeIPAddressClient is the azure Synapse Analytics Management Client +type IntegrationRuntimeNodeIPAddressClient struct { + BaseClient +} + +// NewIntegrationRuntimeNodeIPAddressClient creates an instance of the IntegrationRuntimeNodeIPAddressClient client. +func NewIntegrationRuntimeNodeIPAddressClient(subscriptionID string) IntegrationRuntimeNodeIPAddressClient { + return NewIntegrationRuntimeNodeIPAddressClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationRuntimeNodeIPAddressClientWithBaseURI creates an instance of the IntegrationRuntimeNodeIPAddressClient +// 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 NewIntegrationRuntimeNodeIPAddressClientWithBaseURI(baseURI string, subscriptionID string) IntegrationRuntimeNodeIPAddressClient { + return IntegrationRuntimeNodeIPAddressClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get the IP address of an integration runtime node +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// integrationRuntimeName - integration runtime name +// nodeName - integration runtime node name +func (client IntegrationRuntimeNodeIPAddressClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, nodeName string) (result IntegrationRuntimeNodeIPAddress, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeNodeIPAddressClient.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.IntegrationRuntimeNodeIPAddressClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName, nodeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeNodeIPAddressClient", "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.IntegrationRuntimeNodeIPAddressClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeNodeIPAddressClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationRuntimeNodeIPAddressClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, nodeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "nodeName": autorest.Encode("path", nodeName), + "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}/nodes/{nodeName}/ipAddress", 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 IntegrationRuntimeNodeIPAddressClient) 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 IntegrationRuntimeNodeIPAddressClient) GetResponder(resp *http.Response) (result IntegrationRuntimeNodeIPAddress, 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/integrationruntimenodes.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimenodes.go new file mode 100644 index 000000000000..6d84b6793f16 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimenodes.go @@ -0,0 +1,313 @@ +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" +) + +// IntegrationRuntimeNodesClient is the azure Synapse Analytics Management Client +type IntegrationRuntimeNodesClient struct { + BaseClient +} + +// NewIntegrationRuntimeNodesClient creates an instance of the IntegrationRuntimeNodesClient client. +func NewIntegrationRuntimeNodesClient(subscriptionID string) IntegrationRuntimeNodesClient { + return NewIntegrationRuntimeNodesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationRuntimeNodesClientWithBaseURI creates an instance of the IntegrationRuntimeNodesClient 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 NewIntegrationRuntimeNodesClientWithBaseURI(baseURI string, subscriptionID string) IntegrationRuntimeNodesClient { + return IntegrationRuntimeNodesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete delete an integration runtime node +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// integrationRuntimeName - integration runtime name +// nodeName - integration runtime node name +func (client IntegrationRuntimeNodesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, nodeName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeNodesClient.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.IntegrationRuntimeNodesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName, nodeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeNodesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeNodesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeNodesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationRuntimeNodesClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, nodeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "nodeName": autorest.Encode("path", nodeName), + "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}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}", 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 IntegrationRuntimeNodesClient) 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 IntegrationRuntimeNodesClient) 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 an integration runtime node +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// integrationRuntimeName - integration runtime name +// nodeName - integration runtime node name +func (client IntegrationRuntimeNodesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, nodeName string) (result SelfHostedIntegrationRuntimeNode, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeNodesClient.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.IntegrationRuntimeNodesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName, nodeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeNodesClient", "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.IntegrationRuntimeNodesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeNodesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationRuntimeNodesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, nodeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "nodeName": autorest.Encode("path", nodeName), + "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}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}", 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 IntegrationRuntimeNodesClient) 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 IntegrationRuntimeNodesClient) GetResponder(resp *http.Response) (result SelfHostedIntegrationRuntimeNode, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update create an integration runtime node +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// integrationRuntimeName - integration runtime name +// nodeName - integration runtime node name +// updateIntegrationRuntimeNodeRequest - the parameters for updating an integration runtime node. +func (client IntegrationRuntimeNodesClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, nodeName string, updateIntegrationRuntimeNodeRequest UpdateIntegrationRuntimeNodeRequest) (result SelfHostedIntegrationRuntimeNode, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeNodesClient.Update") + 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.IntegrationRuntimeNodesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName, nodeName, updateIntegrationRuntimeNodeRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeNodesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeNodesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeNodesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client IntegrationRuntimeNodesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, nodeName string, updateIntegrationRuntimeNodeRequest UpdateIntegrationRuntimeNodeRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "nodeName": autorest.Encode("path", nodeName), + "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.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}", pathParameters), + autorest.WithJSON(updateIntegrationRuntimeNodeRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimeNodesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimeNodesClient) UpdateResponder(resp *http.Response) (result SelfHostedIntegrationRuntimeNode, 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/integrationruntimeobjectmetadata.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimeobjectmetadata.go new file mode 100644 index 000000000000..db1273ff0965 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimeobjectmetadata.go @@ -0,0 +1,224 @@ +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" +) + +// IntegrationRuntimeObjectMetadataClient is the azure Synapse Analytics Management Client +type IntegrationRuntimeObjectMetadataClient struct { + BaseClient +} + +// NewIntegrationRuntimeObjectMetadataClient creates an instance of the IntegrationRuntimeObjectMetadataClient client. +func NewIntegrationRuntimeObjectMetadataClient(subscriptionID string) IntegrationRuntimeObjectMetadataClient { + return NewIntegrationRuntimeObjectMetadataClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationRuntimeObjectMetadataClientWithBaseURI creates an instance of the +// IntegrationRuntimeObjectMetadataClient 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 NewIntegrationRuntimeObjectMetadataClientWithBaseURI(baseURI string, subscriptionID string) IntegrationRuntimeObjectMetadataClient { + return IntegrationRuntimeObjectMetadataClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeObjectMetadataClient.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.IntegrationRuntimeObjectMetadataClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName, getMetadataRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataClient", "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.IntegrationRuntimeObjectMetadataClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataClient", "Get", 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) { + 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.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/getObjectMetadata", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if getMetadataRequest != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(getMetadataRequest)) + } + 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 IntegrationRuntimeObjectMetadataClient) 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 IntegrationRuntimeObjectMetadataClient) GetResponder(resp *http.Response) (result SsisObjectMetadataListResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Refresh refresh the object metadata in 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 IntegrationRuntimeObjectMetadataClient) Refresh(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result SsisObjectMetadataStatusResponse, 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 + } + 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.IntegrationRuntimeObjectMetadataClient", "Refresh", err.Error()) + } + + req, err := client.RefreshPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataClient", "Refresh", nil, "Failure preparing request") + return + } + + resp, err := client.RefreshSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataClient", "Refresh", resp, "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 +} + +// RefreshPreparer prepares the Refresh request. +func (client IntegrationRuntimeObjectMetadataClient) RefreshPreparer(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}/refreshObjectMetadata", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// 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)) +} + +// RefreshResponder handles the response to the Refresh request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimeObjectMetadataClient) RefreshResponder(resp *http.Response) (result SsisObjectMetadataStatusResponse, 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/integrationruntimes.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimes.go new file mode 100644 index 000000000000..fddf277725d0 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimes.go @@ -0,0 +1,793 @@ +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" +) + +// IntegrationRuntimesClient is the azure Synapse Analytics Management Client +type IntegrationRuntimesClient struct { + BaseClient +} + +// NewIntegrationRuntimesClient creates an instance of the IntegrationRuntimesClient client. +func NewIntegrationRuntimesClient(subscriptionID string) IntegrationRuntimesClient { + return NewIntegrationRuntimesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationRuntimesClientWithBaseURI creates an instance of the IntegrationRuntimesClient 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 NewIntegrationRuntimesClientWithBaseURI(baseURI string, subscriptionID string) IntegrationRuntimesClient { + return IntegrationRuntimesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create 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 +// integrationRuntime - integration runtime resource definition. +// ifMatch - eTag of the integration runtime entity. Should only be specified for update, for which it should +// match existing entity or can be * for unconditional update. +func (client IntegrationRuntimesClient) Create(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, integrationRuntime IntegrationRuntimeResource, ifMatch string) (result IntegrationRuntimeResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimesClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.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: integrationRuntime, + Constraints: []validation.Constraint{{Target: "integrationRuntime.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("synapse.IntegrationRuntimesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName, integrationRuntime, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client IntegrationRuntimesClient) CreatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, integrationRuntime IntegrationRuntimeResource, ifMatch 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.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}", pathParameters), + autorest.WithJSON(integrationRuntime), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) CreateResponder(resp *http.Response) (result IntegrationRuntimeResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete 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 IntegrationRuntimesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimesClient.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.IntegrationRuntimesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationRuntimesClient) DeletePreparer(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.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}", 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 IntegrationRuntimesClient) 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 IntegrationRuntimesClient) 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 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 +// ifNoneMatch - eTag of the integration runtime entity. Should only be specified for get. If the ETag matches +// the existing entity tag, or if * was provided, then no content will be returned. +func (client IntegrationRuntimesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, ifNoneMatch string) (result IntegrationRuntimeResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimesClient.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.IntegrationRuntimesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName, ifNoneMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "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.IntegrationRuntimesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationRuntimesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, ifNoneMatch 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.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + 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 IntegrationRuntimesClient) 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 IntegrationRuntimesClient) GetResponder(resp *http.Response) (result IntegrationRuntimeResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotModified), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace list all integration runtimes +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client IntegrationRuntimesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result IntegrationRuntimeListResponsePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimesClient.ListByWorkspace") + defer func() { + sc := -1 + if result.irlr.Response.Response != nil { + sc = result.irlr.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.IntegrationRuntimesClient", "ListByWorkspace", err.Error()) + } + + result.fn = client.listByWorkspaceNextResults + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.irlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result.irlr, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client IntegrationRuntimesClient) 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}/integrationRuntimes", 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 IntegrationRuntimesClient) 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 IntegrationRuntimesClient) ListByWorkspaceResponder(resp *http.Response) (result IntegrationRuntimeListResponse, 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 IntegrationRuntimesClient) listByWorkspaceNextResults(ctx context.Context, lastResults IntegrationRuntimeListResponse) (result IntegrationRuntimeListResponse, err error) { + req, err := lastResults.integrationRuntimeListResponsePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "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.IntegrationRuntimesClient", "listByWorkspaceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "listByWorkspaceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByWorkspaceComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationRuntimesClient) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result IntegrationRuntimeListResponseIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimesClient.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 +} + +// Start start 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 IntegrationRuntimesClient) Start(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result IntegrationRuntimeStatusResponse, 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 + } + 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", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Start", nil, "Failure preparing request") + return + } + + resp, err := client.StartSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Start", resp, "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 +} + +// StartPreparer prepares the Start request. +func (client IntegrationRuntimesClient) StartPreparer(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}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// 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)) +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) StartResponder(resp *http.Response) (result IntegrationRuntimeStatusResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Stop stop 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 IntegrationRuntimesClient) Stop(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimesClient.Stop") + 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", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Stop", nil, "Failure preparing request") + return + } + + resp, err := client.StopSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Stop", resp, "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 +} + +// StopPreparer prepares the Stop request. +func (client IntegrationRuntimesClient) StopPreparer(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}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// 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)) +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update update 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 +// updateIntegrationRuntimeRequest - the parameters for updating an integration runtime. +func (client IntegrationRuntimesClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, updateIntegrationRuntimeRequest UpdateIntegrationRuntimeRequest) (result IntegrationRuntimeResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimesClient.Update") + 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.IntegrationRuntimesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName, updateIntegrationRuntimeRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client IntegrationRuntimesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, updateIntegrationRuntimeRequest UpdateIntegrationRuntimeRequest) (*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.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}", pathParameters), + autorest.WithJSON(updateIntegrationRuntimeRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) UpdateResponder(resp *http.Response) (result IntegrationRuntimeResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Upgrade upgrade 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 IntegrationRuntimesClient) Upgrade(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimesClient.Upgrade") + 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", "Upgrade", err.Error()) + } + + req, err := client.UpgradePreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Upgrade", nil, "Failure preparing request") + return + } + + resp, err := client.UpgradeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Upgrade", resp, "Failure sending request") + return + } + + result, err = client.UpgradeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesClient", "Upgrade", resp, "Failure responding to request") + } + + return +} + +// UpgradePreparer prepares the Upgrade request. +func (client IntegrationRuntimesClient) UpgradePreparer(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}/upgrade", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpgradeSender sends the Upgrade request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) UpgradeSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpgradeResponder handles the response to the Upgrade request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) UpgradeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimestatus.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimestatus.go new file mode 100644 index 000000000000..cc8ab6ad5c07 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/integrationruntimestatus.go @@ -0,0 +1,131 @@ +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" +) + +// IntegrationRuntimeStatusClient is the azure Synapse Analytics Management Client +type IntegrationRuntimeStatusClient struct { + BaseClient +} + +// NewIntegrationRuntimeStatusClient creates an instance of the IntegrationRuntimeStatusClient client. +func NewIntegrationRuntimeStatusClient(subscriptionID string) IntegrationRuntimeStatusClient { + return NewIntegrationRuntimeStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationRuntimeStatusClientWithBaseURI creates an instance of the IntegrationRuntimeStatusClient 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 NewIntegrationRuntimeStatusClientWithBaseURI(baseURI string, subscriptionID string) IntegrationRuntimeStatusClient { + return IntegrationRuntimeStatusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get the integration runtime status +// 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 IntegrationRuntimeStatusClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result IntegrationRuntimeStatusResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeStatusClient.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.IntegrationRuntimeStatusClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeStatusClient", "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.IntegrationRuntimeStatusClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeStatusClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationRuntimeStatusClient) GetPreparer(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}/getStatus", 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 IntegrationRuntimeStatusClient) 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 IntegrationRuntimeStatusClient) GetResponder(resp *http.Response) (result IntegrationRuntimeStatusResponse, 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/ipfirewallrules.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/ipfirewallrules.go index 81f5dabc3e7e..c732098955a4 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/ipfirewallrules.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/ipfirewallrules.go @@ -125,7 +125,6 @@ func (client IPFirewallRulesClient) CreateOrUpdateSender(req *http.Request) (fut func (client IPFirewallRulesClient) CreateOrUpdateResponder(resp *http.Response) (result IPFirewallRuleInfo, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -213,7 +212,6 @@ func (client IPFirewallRulesClient) DeleteSender(req *http.Request) (future IPFi func (client IPFirewallRulesClient) DeleteResponder(resp *http.Response) (result SetObject, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -221,6 +219,93 @@ func (client IPFirewallRulesClient) DeleteResponder(resp *http.Response) (result return } +// Get get a firewall rule +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// ruleName - the IP firewall rule name +func (client IPFirewallRulesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string) (result IPFirewallRuleInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IPFirewallRulesClient.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.IPFirewallRulesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, ruleName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesClient", "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.IPFirewallRulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IPFirewallRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleName": autorest.Encode("path", ruleName), + "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}/firewallRules/{ruleName}", 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 IPFirewallRulesClient) 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 IPFirewallRulesClient) GetResponder(resp *http.Response) (result IPFirewallRuleInfo, 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 firewall rules // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. @@ -300,7 +385,6 @@ func (client IPFirewallRulesClient) ListByWorkspaceSender(req *http.Request) (*h func (client IPFirewallRulesClient) ListByWorkspaceResponder(resp *http.Response) (result IPFirewallRuleInfoListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -426,7 +510,6 @@ func (client IPFirewallRulesClient) ReplaceAllSender(req *http.Request) (future func (client IPFirewallRulesClient) ReplaceAllResponder(resp *http.Response) (result ReplaceAllFirewallRulesOperationResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) 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 36967508994b..973fa605bfb6 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 @@ -53,6 +53,23 @@ func PossibleActualStateValues() []ActualState { return []ActualState{Disabled, Disabling, Enabled, Enabling, Unknown} } +// AuthorizationType enumerates the values for authorization type. +type AuthorizationType string + +const ( + // AuthorizationTypeKey ... + AuthorizationTypeKey AuthorizationType = "Key" + // AuthorizationTypeLinkedIntegrationRuntimeType ... + AuthorizationTypeLinkedIntegrationRuntimeType AuthorizationType = "LinkedIntegrationRuntimeType" + // AuthorizationTypeRBAC ... + AuthorizationTypeRBAC AuthorizationType = "RBAC" +) + +// PossibleAuthorizationTypeValues returns an array of possible values for the AuthorizationType const type. +func PossibleAuthorizationTypeValues() []AuthorizationType { + return []AuthorizationType{AuthorizationTypeKey, AuthorizationTypeLinkedIntegrationRuntimeType, AuthorizationTypeRBAC} +} + // BlobAuditingPolicyState enumerates the values for blob auditing policy state. type BlobAuditingPolicyState string @@ -147,6 +164,23 @@ func PossibleColumnDataTypeValues() []ColumnDataType { return []ColumnDataType{Bigint, Binary, Bit, Char, Date, Datetime, Datetime2, Datetimeoffset, Decimal, Float, Geography, Geometry, Hierarchyid, Image, Int, Money, Nchar, Ntext, Numeric, Nvarchar, Real, Smalldatetime, Smallint, Smallmoney, SQLVariant, Sysname, Text, Time, Timestamp, Tinyint, Uniqueidentifier, Varbinary, Varchar, XML} } +// DataFlowComputeType enumerates the values for data flow compute type. +type DataFlowComputeType string + +const ( + // ComputeOptimized ... + ComputeOptimized DataFlowComputeType = "ComputeOptimized" + // General ... + General DataFlowComputeType = "General" + // MemoryOptimized ... + MemoryOptimized DataFlowComputeType = "MemoryOptimized" +) + +// PossibleDataFlowComputeTypeValues returns an array of possible values for the DataFlowComputeType const type. +func PossibleDataFlowComputeTypeValues() []DataFlowComputeType { + return []DataFlowComputeType{ComputeOptimized, General, MemoryOptimized} +} + // DesiredState enumerates the values for desired state. type DesiredState string @@ -177,6 +211,201 @@ func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { return []GeoBackupPolicyState{GeoBackupPolicyStateDisabled, GeoBackupPolicyStateEnabled} } +// IntegrationRuntimeAuthKeyName enumerates the values for integration runtime auth key name. +type IntegrationRuntimeAuthKeyName string + +const ( + // AuthKey1 ... + AuthKey1 IntegrationRuntimeAuthKeyName = "authKey1" + // AuthKey2 ... + AuthKey2 IntegrationRuntimeAuthKeyName = "authKey2" +) + +// PossibleIntegrationRuntimeAuthKeyNameValues returns an array of possible values for the IntegrationRuntimeAuthKeyName const type. +func PossibleIntegrationRuntimeAuthKeyNameValues() []IntegrationRuntimeAuthKeyName { + return []IntegrationRuntimeAuthKeyName{AuthKey1, AuthKey2} +} + +// IntegrationRuntimeAutoUpdate enumerates the values for integration runtime auto update. +type IntegrationRuntimeAutoUpdate string + +const ( + // Off ... + Off IntegrationRuntimeAutoUpdate = "Off" + // On ... + On IntegrationRuntimeAutoUpdate = "On" +) + +// PossibleIntegrationRuntimeAutoUpdateValues returns an array of possible values for the IntegrationRuntimeAutoUpdate const type. +func PossibleIntegrationRuntimeAutoUpdateValues() []IntegrationRuntimeAutoUpdate { + return []IntegrationRuntimeAutoUpdate{Off, On} +} + +// IntegrationRuntimeEdition enumerates the values for integration runtime edition. +type IntegrationRuntimeEdition string + +const ( + // Enterprise ... + Enterprise IntegrationRuntimeEdition = "Enterprise" + // Standard ... + Standard IntegrationRuntimeEdition = "Standard" +) + +// PossibleIntegrationRuntimeEditionValues returns an array of possible values for the IntegrationRuntimeEdition const type. +func PossibleIntegrationRuntimeEditionValues() []IntegrationRuntimeEdition { + return []IntegrationRuntimeEdition{Enterprise, Standard} +} + +// IntegrationRuntimeEntityReferenceType enumerates the values for integration runtime entity reference type. +type IntegrationRuntimeEntityReferenceType string + +const ( + // IntegrationRuntimeReference ... + IntegrationRuntimeReference IntegrationRuntimeEntityReferenceType = "IntegrationRuntimeReference" + // LinkedServiceReference ... + LinkedServiceReference IntegrationRuntimeEntityReferenceType = "LinkedServiceReference" +) + +// PossibleIntegrationRuntimeEntityReferenceTypeValues returns an array of possible values for the IntegrationRuntimeEntityReferenceType const type. +func PossibleIntegrationRuntimeEntityReferenceTypeValues() []IntegrationRuntimeEntityReferenceType { + return []IntegrationRuntimeEntityReferenceType{IntegrationRuntimeReference, LinkedServiceReference} +} + +// IntegrationRuntimeInternalChannelEncryptionMode enumerates the values for integration runtime internal +// channel encryption mode. +type IntegrationRuntimeInternalChannelEncryptionMode string + +const ( + // NotEncrypted ... + NotEncrypted IntegrationRuntimeInternalChannelEncryptionMode = "NotEncrypted" + // NotSet ... + NotSet IntegrationRuntimeInternalChannelEncryptionMode = "NotSet" + // SslEncrypted ... + SslEncrypted IntegrationRuntimeInternalChannelEncryptionMode = "SslEncrypted" +) + +// PossibleIntegrationRuntimeInternalChannelEncryptionModeValues returns an array of possible values for the IntegrationRuntimeInternalChannelEncryptionMode const type. +func PossibleIntegrationRuntimeInternalChannelEncryptionModeValues() []IntegrationRuntimeInternalChannelEncryptionMode { + return []IntegrationRuntimeInternalChannelEncryptionMode{NotEncrypted, NotSet, SslEncrypted} +} + +// IntegrationRuntimeLicenseType enumerates the values for integration runtime license type. +type IntegrationRuntimeLicenseType string + +const ( + // BasePrice ... + BasePrice IntegrationRuntimeLicenseType = "BasePrice" + // LicenseIncluded ... + LicenseIncluded IntegrationRuntimeLicenseType = "LicenseIncluded" +) + +// PossibleIntegrationRuntimeLicenseTypeValues returns an array of possible values for the IntegrationRuntimeLicenseType const type. +func PossibleIntegrationRuntimeLicenseTypeValues() []IntegrationRuntimeLicenseType { + return []IntegrationRuntimeLicenseType{BasePrice, LicenseIncluded} +} + +// IntegrationRuntimeSsisCatalogPricingTier enumerates the values for integration runtime ssis catalog pricing +// tier. +type IntegrationRuntimeSsisCatalogPricingTier string + +const ( + // IntegrationRuntimeSsisCatalogPricingTierBasic ... + IntegrationRuntimeSsisCatalogPricingTierBasic IntegrationRuntimeSsisCatalogPricingTier = "Basic" + // IntegrationRuntimeSsisCatalogPricingTierPremium ... + IntegrationRuntimeSsisCatalogPricingTierPremium IntegrationRuntimeSsisCatalogPricingTier = "Premium" + // IntegrationRuntimeSsisCatalogPricingTierPremiumRS ... + IntegrationRuntimeSsisCatalogPricingTierPremiumRS IntegrationRuntimeSsisCatalogPricingTier = "PremiumRS" + // IntegrationRuntimeSsisCatalogPricingTierStandard ... + IntegrationRuntimeSsisCatalogPricingTierStandard IntegrationRuntimeSsisCatalogPricingTier = "Standard" +) + +// PossibleIntegrationRuntimeSsisCatalogPricingTierValues returns an array of possible values for the IntegrationRuntimeSsisCatalogPricingTier const type. +func PossibleIntegrationRuntimeSsisCatalogPricingTierValues() []IntegrationRuntimeSsisCatalogPricingTier { + return []IntegrationRuntimeSsisCatalogPricingTier{IntegrationRuntimeSsisCatalogPricingTierBasic, IntegrationRuntimeSsisCatalogPricingTierPremium, IntegrationRuntimeSsisCatalogPricingTierPremiumRS, IntegrationRuntimeSsisCatalogPricingTierStandard} +} + +// IntegrationRuntimeState enumerates the values for integration runtime state. +type IntegrationRuntimeState string + +const ( + // AccessDenied ... + AccessDenied IntegrationRuntimeState = "AccessDenied" + // Initial ... + Initial IntegrationRuntimeState = "Initial" + // Limited ... + Limited IntegrationRuntimeState = "Limited" + // NeedRegistration ... + NeedRegistration IntegrationRuntimeState = "NeedRegistration" + // Offline ... + Offline IntegrationRuntimeState = "Offline" + // Online ... + Online IntegrationRuntimeState = "Online" + // Started ... + Started IntegrationRuntimeState = "Started" + // Starting ... + Starting IntegrationRuntimeState = "Starting" + // Stopped ... + Stopped IntegrationRuntimeState = "Stopped" + // Stopping ... + Stopping IntegrationRuntimeState = "Stopping" +) + +// PossibleIntegrationRuntimeStateValues returns an array of possible values for the IntegrationRuntimeState const type. +func PossibleIntegrationRuntimeStateValues() []IntegrationRuntimeState { + return []IntegrationRuntimeState{AccessDenied, Initial, Limited, NeedRegistration, Offline, Online, Started, Starting, Stopped, Stopping} +} + +// IntegrationRuntimeType enumerates the values for integration runtime type. +type IntegrationRuntimeType string + +const ( + // Managed ... + Managed IntegrationRuntimeType = "Managed" + // SelfHosted ... + SelfHosted IntegrationRuntimeType = "SelfHosted" +) + +// PossibleIntegrationRuntimeTypeValues returns an array of possible values for the IntegrationRuntimeType const type. +func PossibleIntegrationRuntimeTypeValues() []IntegrationRuntimeType { + return []IntegrationRuntimeType{Managed, SelfHosted} +} + +// IntegrationRuntimeUpdateResult enumerates the values for integration runtime update result. +type IntegrationRuntimeUpdateResult string + +const ( + // Fail ... + Fail IntegrationRuntimeUpdateResult = "Fail" + // None ... + None IntegrationRuntimeUpdateResult = "None" + // Succeed ... + Succeed IntegrationRuntimeUpdateResult = "Succeed" +) + +// PossibleIntegrationRuntimeUpdateResultValues returns an array of possible values for the IntegrationRuntimeUpdateResult const type. +func PossibleIntegrationRuntimeUpdateResultValues() []IntegrationRuntimeUpdateResult { + return []IntegrationRuntimeUpdateResult{Fail, None, Succeed} +} + +// ManagedIntegrationRuntimeNodeStatus enumerates the values for managed integration runtime node status. +type ManagedIntegrationRuntimeNodeStatus string + +const ( + // ManagedIntegrationRuntimeNodeStatusAvailable ... + ManagedIntegrationRuntimeNodeStatusAvailable ManagedIntegrationRuntimeNodeStatus = "Available" + // ManagedIntegrationRuntimeNodeStatusRecycling ... + ManagedIntegrationRuntimeNodeStatusRecycling ManagedIntegrationRuntimeNodeStatus = "Recycling" + // ManagedIntegrationRuntimeNodeStatusStarting ... + ManagedIntegrationRuntimeNodeStatusStarting ManagedIntegrationRuntimeNodeStatus = "Starting" + // ManagedIntegrationRuntimeNodeStatusUnavailable ... + ManagedIntegrationRuntimeNodeStatusUnavailable ManagedIntegrationRuntimeNodeStatus = "Unavailable" +) + +// PossibleManagedIntegrationRuntimeNodeStatusValues returns an array of possible values for the ManagedIntegrationRuntimeNodeStatus const type. +func PossibleManagedIntegrationRuntimeNodeStatusValues() []ManagedIntegrationRuntimeNodeStatus { + return []ManagedIntegrationRuntimeNodeStatus{ManagedIntegrationRuntimeNodeStatusAvailable, ManagedIntegrationRuntimeNodeStatusRecycling, ManagedIntegrationRuntimeNodeStatusStarting, ManagedIntegrationRuntimeNodeStatusUnavailable} +} + // ManagementOperationState enumerates the values for management operation state. type ManagementOperationState string @@ -204,19 +433,19 @@ func PossibleManagementOperationStateValues() []ManagementOperationState { type NodeSize string const ( - // Large ... - Large NodeSize = "Large" - // Medium ... - Medium NodeSize = "Medium" - // None ... - None NodeSize = "None" - // Small ... - Small NodeSize = "Small" + // NodeSizeLarge ... + NodeSizeLarge NodeSize = "Large" + // NodeSizeMedium ... + NodeSizeMedium NodeSize = "Medium" + // NodeSizeNone ... + NodeSizeNone NodeSize = "None" + // NodeSizeSmall ... + NodeSizeSmall NodeSize = "Small" ) // PossibleNodeSizeValues returns an array of possible values for the NodeSize const type. func PossibleNodeSizeValues() []NodeSize { - return []NodeSize{Large, Medium, None, Small} + return []NodeSize{NodeSizeLarge, NodeSizeMedium, NodeSizeNone, NodeSizeSmall} } // NodeSizeFamily enumerates the values for node size family. @@ -274,6 +503,21 @@ 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 @@ -439,6 +683,70 @@ func PossibleSecurityAlertPolicyStateValues() []SecurityAlertPolicyState { return []SecurityAlertPolicyState{SecurityAlertPolicyStateDisabled, SecurityAlertPolicyStateEnabled, SecurityAlertPolicyStateNew} } +// SelfHostedIntegrationRuntimeNodeStatus enumerates the values for self hosted integration runtime node +// status. +type SelfHostedIntegrationRuntimeNodeStatus string + +const ( + // SelfHostedIntegrationRuntimeNodeStatusInitializeFailed ... + SelfHostedIntegrationRuntimeNodeStatusInitializeFailed SelfHostedIntegrationRuntimeNodeStatus = "InitializeFailed" + // SelfHostedIntegrationRuntimeNodeStatusInitializing ... + SelfHostedIntegrationRuntimeNodeStatusInitializing SelfHostedIntegrationRuntimeNodeStatus = "Initializing" + // SelfHostedIntegrationRuntimeNodeStatusLimited ... + SelfHostedIntegrationRuntimeNodeStatusLimited SelfHostedIntegrationRuntimeNodeStatus = "Limited" + // SelfHostedIntegrationRuntimeNodeStatusNeedRegistration ... + SelfHostedIntegrationRuntimeNodeStatusNeedRegistration SelfHostedIntegrationRuntimeNodeStatus = "NeedRegistration" + // SelfHostedIntegrationRuntimeNodeStatusOffline ... + SelfHostedIntegrationRuntimeNodeStatusOffline SelfHostedIntegrationRuntimeNodeStatus = "Offline" + // SelfHostedIntegrationRuntimeNodeStatusOnline ... + SelfHostedIntegrationRuntimeNodeStatusOnline SelfHostedIntegrationRuntimeNodeStatus = "Online" + // SelfHostedIntegrationRuntimeNodeStatusUpgrading ... + SelfHostedIntegrationRuntimeNodeStatusUpgrading SelfHostedIntegrationRuntimeNodeStatus = "Upgrading" +) + +// PossibleSelfHostedIntegrationRuntimeNodeStatusValues returns an array of possible values for the SelfHostedIntegrationRuntimeNodeStatus const type. +func PossibleSelfHostedIntegrationRuntimeNodeStatusValues() []SelfHostedIntegrationRuntimeNodeStatus { + return []SelfHostedIntegrationRuntimeNodeStatus{SelfHostedIntegrationRuntimeNodeStatusInitializeFailed, SelfHostedIntegrationRuntimeNodeStatusInitializing, SelfHostedIntegrationRuntimeNodeStatusLimited, SelfHostedIntegrationRuntimeNodeStatusNeedRegistration, SelfHostedIntegrationRuntimeNodeStatusOffline, SelfHostedIntegrationRuntimeNodeStatusOnline, SelfHostedIntegrationRuntimeNodeStatusUpgrading} +} + +// SsisObjectMetadataType enumerates the values for ssis object metadata type. +type SsisObjectMetadataType string + +const ( + // Environment ... + Environment SsisObjectMetadataType = "Environment" + // Folder ... + Folder SsisObjectMetadataType = "Folder" + // Package ... + Package SsisObjectMetadataType = "Package" + // Project ... + Project SsisObjectMetadataType = "Project" +) + +// PossibleSsisObjectMetadataTypeValues returns an array of possible values for the SsisObjectMetadataType const type. +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 @@ -454,6 +762,95 @@ func PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryption return []TransparentDataEncryptionStatus{TransparentDataEncryptionStatusDisabled, TransparentDataEncryptionStatusEnabled} } +// Type enumerates the values for type. +type Type string + +const ( + // TypeIntegrationRuntime ... + TypeIntegrationRuntime Type = "IntegrationRuntime" + // TypeManaged ... + TypeManaged Type = "Managed" + // TypeSelfHosted ... + TypeSelfHosted Type = "SelfHosted" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeIntegrationRuntime, TypeManaged, TypeSelfHosted} +} + +// TypeBasicCustomSetupBase enumerates the values for type basic custom setup base. +type TypeBasicCustomSetupBase string + +const ( + // TypeCmdkeySetup ... + TypeCmdkeySetup TypeBasicCustomSetupBase = "CmdkeySetup" + // TypeComponentSetup ... + TypeComponentSetup TypeBasicCustomSetupBase = "ComponentSetup" + // TypeCustomSetupBase ... + TypeCustomSetupBase TypeBasicCustomSetupBase = "CustomSetupBase" + // TypeEnvironmentVariableSetup ... + TypeEnvironmentVariableSetup TypeBasicCustomSetupBase = "EnvironmentVariableSetup" +) + +// PossibleTypeBasicCustomSetupBaseValues returns an array of possible values for the TypeBasicCustomSetupBase const type. +func PossibleTypeBasicCustomSetupBaseValues() []TypeBasicCustomSetupBase { + return []TypeBasicCustomSetupBase{TypeCmdkeySetup, TypeComponentSetup, TypeCustomSetupBase, TypeEnvironmentVariableSetup} +} + +// TypeBasicIntegrationRuntimeStatus enumerates the values for type basic integration runtime status. +type TypeBasicIntegrationRuntimeStatus string + +const ( + // TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus ... + TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus TypeBasicIntegrationRuntimeStatus = "IntegrationRuntimeStatus" + // TypeBasicIntegrationRuntimeStatusTypeManaged ... + TypeBasicIntegrationRuntimeStatusTypeManaged TypeBasicIntegrationRuntimeStatus = "Managed" + // TypeBasicIntegrationRuntimeStatusTypeSelfHosted ... + TypeBasicIntegrationRuntimeStatusTypeSelfHosted TypeBasicIntegrationRuntimeStatus = "SelfHosted" +) + +// PossibleTypeBasicIntegrationRuntimeStatusValues returns an array of possible values for the TypeBasicIntegrationRuntimeStatus const type. +func PossibleTypeBasicIntegrationRuntimeStatusValues() []TypeBasicIntegrationRuntimeStatus { + return []TypeBasicIntegrationRuntimeStatus{TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus, TypeBasicIntegrationRuntimeStatusTypeManaged, TypeBasicIntegrationRuntimeStatusTypeSelfHosted} +} + +// TypeBasicSecretBase enumerates the values for type basic secret base. +type TypeBasicSecretBase string + +const ( + // TypeSecretBase ... + TypeSecretBase TypeBasicSecretBase = "SecretBase" + // TypeSecureString ... + TypeSecureString TypeBasicSecretBase = "SecureString" +) + +// PossibleTypeBasicSecretBaseValues returns an array of possible values for the TypeBasicSecretBase const type. +func PossibleTypeBasicSecretBaseValues() []TypeBasicSecretBase { + return []TypeBasicSecretBase{TypeSecretBase, TypeSecureString} +} + +// TypeBasicSsisObjectMetadata enumerates the values for type basic ssis object metadata. +type TypeBasicSsisObjectMetadata string + +const ( + // TypeEnvironment ... + TypeEnvironment TypeBasicSsisObjectMetadata = "Environment" + // TypeFolder ... + TypeFolder TypeBasicSsisObjectMetadata = "Folder" + // TypePackage ... + TypePackage TypeBasicSsisObjectMetadata = "Package" + // TypeProject ... + TypeProject TypeBasicSsisObjectMetadata = "Project" + // TypeSsisObjectMetadata ... + TypeSsisObjectMetadata TypeBasicSsisObjectMetadata = "SsisObjectMetadata" +) + +// PossibleTypeBasicSsisObjectMetadataValues returns an array of possible values for the TypeBasicSsisObjectMetadata const type. +func PossibleTypeBasicSsisObjectMetadataValues() []TypeBasicSsisObjectMetadata { + return []TypeBasicSsisObjectMetadata{TypeEnvironment, TypeFolder, TypePackage, TypeProject, TypeSsisObjectMetadata} +} + // VulnerabilityAssessmentPolicyBaselineName enumerates the values for vulnerability assessment policy baseline // name. type VulnerabilityAssessmentPolicyBaselineName string @@ -936,7 +1333,7 @@ type BigDataPoolResourceProperties struct { 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: 'None', 'Small', 'Medium', 'Large' + // NodeSize - The level of compute power that each node in the Big Data pool has. Possible values include: 'NodeSizeNone', 'NodeSizeSmall', 'NodeSizeMedium', 'NodeSizeLarge' 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"` @@ -1021,45 +1418,105 @@ type CheckNameAvailabilityResponse struct { Name *string `json:"name,omitempty"` } -// 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"` +// CloudError the object that defines the structure of an Azure Synapse error response. +type CloudError struct { + // CloudErrorBody - Error data + *CloudErrorBody `json:"error,omitempty"` } -// DataLakeStorageAccountDetails details of the data lake storage account associated with the workspace -type DataLakeStorageAccountDetails struct { - // AccountURL - Account URL - AccountURL *string `json:"accountUrl,omitempty"` - // Filesystem - Filesystem name - Filesystem *string `json:"filesystem,omitempty"` +// MarshalJSON is the custom marshaler for CloudError. +func (ce CloudError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ce.CloudErrorBody != nil { + objectMap["error"] = ce.CloudErrorBody + } + return json.Marshal(objectMap) } -// DataWarehouseUserActivities user activities of a data warehouse -type DataWarehouseUserActivities 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} - 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"` +// UnmarshalJSON is the custom unmarshaler for CloudError struct. +func (ce *CloudError) 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 "error": + if v != nil { + var cloudErrorBody CloudErrorBody + err = json.Unmarshal(*v, &cloudErrorBody) + if err != nil { + return err + } + ce.CloudErrorBody = &cloudErrorBody + } + } + } + + return nil } -// MarshalJSON is the custom marshaler for DataWarehouseUserActivities. -func (dwua DataWarehouseUserActivities) MarshalJSON() ([]byte, error) { +// CloudErrorBody the object that defines the structure of an Azure Synapse error. +type CloudErrorBody struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` + // Target - Property name/path in request associated with error. + Target *string `json:"target,omitempty"` + // Details - Array with additional error details. + Details *[]CloudError `json:"details,omitempty"` +} + +// CmdkeySetup the custom setup of running cmdkey commands. +type CmdkeySetup struct { + // CmdkeySetupTypeProperties - Cmdkey command custom setup type properties. + *CmdkeySetupTypeProperties `json:"typeProperties,omitempty"` + // Type - Possible values include: 'TypeCustomSetupBase', 'TypeCmdkeySetup', 'TypeEnvironmentVariableSetup', 'TypeComponentSetup' + Type TypeBasicCustomSetupBase `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CmdkeySetup. +func (cs CmdkeySetup) MarshalJSON() ([]byte, error) { + cs.Type = TypeCmdkeySetup objectMap := make(map[string]interface{}) - if dwua.DataWarehouseUserActivitiesProperties != nil { - objectMap["properties"] = dwua.DataWarehouseUserActivitiesProperties + if cs.CmdkeySetupTypeProperties != nil { + objectMap["typeProperties"] = cs.CmdkeySetupTypeProperties + } + if cs.Type != "" { + objectMap["type"] = cs.Type } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DataWarehouseUserActivities struct. -func (dwua *DataWarehouseUserActivities) UnmarshalJSON(body []byte) error { +// AsCmdkeySetup is the BasicCustomSetupBase implementation for CmdkeySetup. +func (cs CmdkeySetup) AsCmdkeySetup() (*CmdkeySetup, bool) { + return &cs, true +} + +// AsEnvironmentVariableSetup is the BasicCustomSetupBase implementation for CmdkeySetup. +func (cs CmdkeySetup) AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) { + return nil, false +} + +// AsComponentSetup is the BasicCustomSetupBase implementation for CmdkeySetup. +func (cs CmdkeySetup) AsComponentSetup() (*ComponentSetup, bool) { + return nil, false +} + +// AsCustomSetupBase is the BasicCustomSetupBase implementation for CmdkeySetup. +func (cs CmdkeySetup) AsCustomSetupBase() (*CustomSetupBase, bool) { + return nil, false +} + +// AsBasicCustomSetupBase is the BasicCustomSetupBase implementation for CmdkeySetup. +func (cs CmdkeySetup) AsBasicCustomSetupBase() (BasicCustomSetupBase, bool) { + return &cs, true +} + +// UnmarshalJSON is the custom unmarshaler for CmdkeySetup struct. +func (cs *CmdkeySetup) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1067,41 +1524,74 @@ func (dwua *DataWarehouseUserActivities) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": + case "typeProperties": if v != nil { - var dataWarehouseUserActivitiesProperties DataWarehouseUserActivitiesProperties - err = json.Unmarshal(*v, &dataWarehouseUserActivitiesProperties) + var cmdkeySetupTypeProperties CmdkeySetupTypeProperties + err = json.Unmarshal(*v, &cmdkeySetupTypeProperties) if err != nil { return err } - dwua.DataWarehouseUserActivitiesProperties = &dataWarehouseUserActivitiesProperties + cs.CmdkeySetupTypeProperties = &cmdkeySetupTypeProperties } - case "id": + case "type": if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var typeVar TypeBasicCustomSetupBase + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - dwua.ID = &ID + cs.Type = typeVar } - case "name": + } + } + + return nil +} + +// CmdkeySetupTypeProperties cmdkey command custom setup type properties. +type CmdkeySetupTypeProperties struct { + // TargetName - The server name of data source access. + TargetName interface{} `json:"targetName,omitempty"` + // UserName - The user name of data source access. + UserName interface{} `json:"userName,omitempty"` + // Password - The password of data source access. + Password BasicSecretBase `json:"password,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CmdkeySetupTypeProperties struct. +func (cstp *CmdkeySetupTypeProperties) 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 "targetName": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var targetName interface{} + err = json.Unmarshal(*v, &targetName) if err != nil { return err } - dwua.Name = &name + cstp.TargetName = targetName } - case "type": + case "userName": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var userName interface{} + err = json.Unmarshal(*v, &userName) if err != nil { return err } - dwua.Type = &typeVar + cstp.UserName = userName + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + cstp.Password = password } } } @@ -1109,25 +1599,381 @@ 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"` +// ComponentSetup the custom setup of installing 3rd party components. +type ComponentSetup struct { + // LicensedComponentSetupTypeProperties - Install 3rd party component type properties. + *LicensedComponentSetupTypeProperties `json:"typeProperties,omitempty"` + // Type - Possible values include: 'TypeCustomSetupBase', 'TypeCmdkeySetup', 'TypeEnvironmentVariableSetup', 'TypeComponentSetup' + Type TypeBasicCustomSetupBase `json:"type,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"` +// MarshalJSON is the custom marshaler for ComponentSetup. +func (cs ComponentSetup) MarshalJSON() ([]byte, error) { + cs.Type = TypeComponentSetup + objectMap := make(map[string]interface{}) + if cs.LicensedComponentSetupTypeProperties != nil { + objectMap["typeProperties"] = cs.LicensedComponentSetupTypeProperties + } + if cs.Type != "" { + objectMap["type"] = cs.Type + } + return json.Marshal(objectMap) } -// ErrorContract contains details when the response code indicates an error. -type ErrorContract struct { - // Error - The error details. +// AsCmdkeySetup is the BasicCustomSetupBase implementation for ComponentSetup. +func (cs ComponentSetup) AsCmdkeySetup() (*CmdkeySetup, bool) { + return nil, false +} + +// AsEnvironmentVariableSetup is the BasicCustomSetupBase implementation for ComponentSetup. +func (cs ComponentSetup) AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) { + return nil, false +} + +// AsComponentSetup is the BasicCustomSetupBase implementation for ComponentSetup. +func (cs ComponentSetup) AsComponentSetup() (*ComponentSetup, bool) { + return &cs, true +} + +// AsCustomSetupBase is the BasicCustomSetupBase implementation for ComponentSetup. +func (cs ComponentSetup) AsCustomSetupBase() (*CustomSetupBase, bool) { + return nil, false +} + +// AsBasicCustomSetupBase is the BasicCustomSetupBase implementation for ComponentSetup. +func (cs ComponentSetup) AsBasicCustomSetupBase() (BasicCustomSetupBase, bool) { + return &cs, true +} + +// UnmarshalJSON is the custom unmarshaler for ComponentSetup struct. +func (cs *ComponentSetup) 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 licensedComponentSetupTypeProperties LicensedComponentSetupTypeProperties + err = json.Unmarshal(*v, &licensedComponentSetupTypeProperties) + if err != nil { + return err + } + cs.LicensedComponentSetupTypeProperties = &licensedComponentSetupTypeProperties + } + case "type": + if v != nil { + var typeVar TypeBasicCustomSetupBase + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cs.Type = typeVar + } + } + } + + return nil +} + +// 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"` +} + +// BasicCustomSetupBase the base definition of the custom setup. +type BasicCustomSetupBase interface { + AsCmdkeySetup() (*CmdkeySetup, bool) + AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) + AsComponentSetup() (*ComponentSetup, bool) + AsCustomSetupBase() (*CustomSetupBase, bool) +} + +// CustomSetupBase the base definition of the custom setup. +type CustomSetupBase struct { + // Type - Possible values include: 'TypeCustomSetupBase', 'TypeCmdkeySetup', 'TypeEnvironmentVariableSetup', 'TypeComponentSetup' + Type TypeBasicCustomSetupBase `json:"type,omitempty"` +} + +func unmarshalBasicCustomSetupBase(body []byte) (BasicCustomSetupBase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeCmdkeySetup): + var cs CmdkeySetup + err := json.Unmarshal(body, &cs) + return cs, err + case string(TypeEnvironmentVariableSetup): + var evs EnvironmentVariableSetup + err := json.Unmarshal(body, &evs) + return evs, err + case string(TypeComponentSetup): + var cs ComponentSetup + err := json.Unmarshal(body, &cs) + return cs, err + default: + var csb CustomSetupBase + err := json.Unmarshal(body, &csb) + return csb, err + } +} +func unmarshalBasicCustomSetupBaseArray(body []byte) ([]BasicCustomSetupBase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + csbArray := make([]BasicCustomSetupBase, len(rawMessages)) + + for index, rawMessage := range rawMessages { + csb, err := unmarshalBasicCustomSetupBase(*rawMessage) + if err != nil { + return nil, err + } + csbArray[index] = csb + } + return csbArray, nil +} + +// MarshalJSON is the custom marshaler for CustomSetupBase. +func (csb CustomSetupBase) MarshalJSON() ([]byte, error) { + csb.Type = TypeCustomSetupBase + objectMap := make(map[string]interface{}) + if csb.Type != "" { + objectMap["type"] = csb.Type + } + return json.Marshal(objectMap) +} + +// AsCmdkeySetup is the BasicCustomSetupBase implementation for CustomSetupBase. +func (csb CustomSetupBase) AsCmdkeySetup() (*CmdkeySetup, bool) { + return nil, false +} + +// AsEnvironmentVariableSetup is the BasicCustomSetupBase implementation for CustomSetupBase. +func (csb CustomSetupBase) AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) { + return nil, false +} + +// AsComponentSetup is the BasicCustomSetupBase implementation for CustomSetupBase. +func (csb CustomSetupBase) AsComponentSetup() (*ComponentSetup, bool) { + return nil, false +} + +// AsCustomSetupBase is the BasicCustomSetupBase implementation for CustomSetupBase. +func (csb CustomSetupBase) AsCustomSetupBase() (*CustomSetupBase, bool) { + return &csb, true +} + +// AsBasicCustomSetupBase is the BasicCustomSetupBase implementation for CustomSetupBase. +func (csb CustomSetupBase) AsBasicCustomSetupBase() (BasicCustomSetupBase, bool) { + return &csb, true +} + +// DataLakeStorageAccountDetails details of the data lake storage account associated with the workspace +type DataLakeStorageAccountDetails struct { + // AccountURL - Account URL + AccountURL *string `json:"accountUrl,omitempty"` + // Filesystem - Filesystem name + Filesystem *string `json:"filesystem,omitempty"` +} + +// DataWarehouseUserActivities user activities of a data warehouse +type DataWarehouseUserActivities 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} + 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"` +} + +// MarshalJSON is the custom marshaler for DataWarehouseUserActivities. +func (dwua DataWarehouseUserActivities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dwua.DataWarehouseUserActivitiesProperties != nil { + objectMap["properties"] = dwua.DataWarehouseUserActivitiesProperties + } + return json.Marshal(objectMap) +} + +// 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 { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dataWarehouseUserActivitiesProperties DataWarehouseUserActivitiesProperties + err = json.Unmarshal(*v, &dataWarehouseUserActivitiesProperties) + if err != nil { + return err + } + dwua.DataWarehouseUserActivitiesProperties = &dataWarehouseUserActivitiesProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dwua.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dwua.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dwua.Type = &typeVar + } + } + } + + 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"` +} + +// MarshalJSON is the custom marshaler for EnvironmentVariableSetup. +func (evs EnvironmentVariableSetup) MarshalJSON() ([]byte, error) { + evs.Type = TypeEnvironmentVariableSetup + objectMap := make(map[string]interface{}) + if evs.EnvironmentVariableSetupTypeProperties != nil { + objectMap["typeProperties"] = evs.EnvironmentVariableSetupTypeProperties + } + if evs.Type != "" { + objectMap["type"] = evs.Type + } + 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 +} + +// 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 { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var environmentVariableSetupTypeProperties EnvironmentVariableSetupTypeProperties + err = json.Unmarshal(*v, &environmentVariableSetupTypeProperties) + if err != nil { + return err + } + evs.EnvironmentVariableSetupTypeProperties = &environmentVariableSetupTypeProperties + } + case "type": + if v != nil { + var typeVar TypeBasicCustomSetupBase + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + evs.Type = typeVar + } + } + } + + 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"` } @@ -1258,72 +2104,144 @@ type GeoBackupPolicyProperties struct { StorageType *string `json:"storageType,omitempty"` } -// 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` +// GetSsisObjectMetadataRequest the request payload of get SSIS object metadata. +type GetSsisObjectMetadataRequest struct { + // MetadataPath - Metadata path. + MetadataPath *string `json:"metadataPath,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) +// 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) } -// UnmarshalJSON is the custom unmarshaler for IPFirewallRuleInfo struct. -func (ifri *IPFirewallRuleInfo) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage +// 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 err + 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 + } +} +func unmarshalBasicIntegrationRuntimeArray(body []byte) ([]BasicIntegrationRuntime, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, 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": + + 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) +} + +// 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 ID string - err = json.Unmarshal(*v, &ID) + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) if err != nil { return err } - ifri.ID = &ID + if ir.AdditionalProperties == nil { + ir.AdditionalProperties = make(map[string]interface{}) + } + ir.AdditionalProperties[k] = additionalProperties } - case "name": + case "description": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var description string + err = json.Unmarshal(*v, &description) if err != nil { return err } - ifri.Name = &name + ir.Description = &description } case "type": if v != nil { - var typeVar string + var typeVar Type err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - ifri.Type = &typeVar + ir.Type = typeVar } } } @@ -1331,26 +2249,375 @@ func (ifri *IPFirewallRuleInfo) UnmarshalJSON(body []byte) error { return nil } -// IPFirewallRuleInfoListResult list of IP firewall rules -type IPFirewallRuleInfoListResult struct { +// IntegrationRuntimeAuthKeys the integration runtime authentication keys. +type IntegrationRuntimeAuthKeys struct { autorest.Response `json:"-"` - // NextLink - Link to next page of results + // 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 + 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 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 IntegrationRuntimeComputeProperties struct. +func (ircp *IntegrationRuntimeComputeProperties) 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 ircp.AdditionalProperties == nil { + ircp.AdditionalProperties = make(map[string]interface{}) + } + ircp.AdditionalProperties[k] = additionalProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + 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 + } + case "numberOfNodes": + if v != nil { + var numberOfNodes int32 + err = json.Unmarshal(*v, &numberOfNodes) + if err != nil { + return err + } + ircp.NumberOfNodes = &numberOfNodes + } + 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"` - // Value - List of IP firewall rules - Value *[]IPFirewallRuleInfo `json:"value,omitempty"` } -// IPFirewallRuleInfoListResultIterator provides access to a complete listing of IPFirewallRuleInfo values. -type IPFirewallRuleInfoListResultIterator struct { +// IntegrationRuntimeListResponseIterator provides access to a complete listing of +// IntegrationRuntimeResource values. +type IntegrationRuntimeListResponseIterator struct { i int - page IPFirewallRuleInfoListResultPage + 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 *IPFirewallRuleInfoListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *IntegrationRuntimeListResponseIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPFirewallRuleInfoListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeListResponseIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -1375,62 +2642,62 @@ 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 *IntegrationRuntimeListResponseIterator) 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 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 IPFirewallRuleInfoListResultIterator) Response() IPFirewallRuleInfoListResult { +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 IPFirewallRuleInfoListResultIterator) Value() IPFirewallRuleInfo { +func (iter IntegrationRuntimeListResponseIterator) Value() IntegrationRuntimeResource { if !iter.page.NotDone() { - return IPFirewallRuleInfo{} + return IntegrationRuntimeResource{} } 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 IntegrationRuntimeListResponseIterator type. +func NewIntegrationRuntimeListResponseIterator(page IntegrationRuntimeListResponsePage) IntegrationRuntimeListResponseIterator { + return IntegrationRuntimeListResponseIterator{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 (irlr IntegrationRuntimeListResponse) IsEmpty() bool { + return irlr.Value == nil || len(*irlr.Value) == 0 } -// iPFirewallRuleInfoListResultPreparer prepares a request to retrieve the next set of results. +// integrationRuntimeListResponsePreparer 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.NextLink == nil || len(to.String(ifrilr.NextLink)) < 1 { +func (irlr IntegrationRuntimeListResponse) integrationRuntimeListResponsePreparer(ctx context.Context) (*http.Request, error) { + if irlr.NextLink == nil || len(to.String(irlr.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(ifrilr.NextLink))) + autorest.WithBaseURL(to.String(irlr.NextLink))) } -// IPFirewallRuleInfoListResultPage contains a page of IPFirewallRuleInfo values. -type IPFirewallRuleInfoListResultPage struct { - fn func(context.Context, IPFirewallRuleInfoListResult) (IPFirewallRuleInfoListResult, error) - ifrilr IPFirewallRuleInfoListResult +// 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 *IPFirewallRuleInfoListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *IntegrationRuntimeListResponsePage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPFirewallRuleInfoListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeListResponsePage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -1439,191 +2706,213 @@ func (page *IPFirewallRuleInfoListResultPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ifrilr) + next, err := page.fn(ctx, page.irlr) if err != nil { return err } - page.ifrilr = next + page.irlr = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *IPFirewallRuleInfoListResultPage) Next() error { +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 IPFirewallRuleInfoListResultPage) NotDone() bool { - return !page.ifrilr.IsEmpty() +func (page IntegrationRuntimeListResponsePage) NotDone() bool { + return !page.irlr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page IPFirewallRuleInfoListResultPage) Response() IPFirewallRuleInfoListResult { - return page.ifrilr +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 IPFirewallRuleInfoListResultPage) Values() []IPFirewallRuleInfo { - if page.ifrilr.IsEmpty() { +func (page IntegrationRuntimeListResponsePage) Values() []IntegrationRuntimeResource { + if page.irlr.IsEmpty() { return nil } - return *page.ifrilr.Value + return *page.irlr.Value } -// Creates a new instance of the IPFirewallRuleInfoListResultPage type. -func NewIPFirewallRuleInfoListResultPage(getNextPage func(context.Context, IPFirewallRuleInfoListResult) (IPFirewallRuleInfoListResult, error)) IPFirewallRuleInfoListResultPage { - return IPFirewallRuleInfoListResultPage{fn: getNextPage} +// Creates a new instance of the IntegrationRuntimeListResponsePage type. +func NewIntegrationRuntimeListResponsePage(getNextPage func(context.Context, IntegrationRuntimeListResponse) (IntegrationRuntimeListResponse, error)) IntegrationRuntimeListResponsePage { + return IntegrationRuntimeListResponsePage{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"` -} - -// 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 +// 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"` } -// 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") - } +// 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 -} - -// IPFirewallRulesReplaceAllFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type IPFirewallRulesReplaceAllFuture struct { - azure.Future + return json.Marshal(objectMap) } -// 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) +// 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 { - err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesReplaceAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("synapse.IPFirewallRulesReplaceAllFuture") - return + return err } - 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") + 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 -} - -// 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"` -} -// ListAvailableRpOperation ... -type ListAvailableRpOperation struct { - autorest.Response `json:"-"` - Value *[]AvailableRpOperation `json:"value,omitempty"` + return nil } -// 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"` +// 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"` } -// ManagedIdentitySQLControlSettingsModel sql Control Settings for workspace managed identity -type ManagedIdentitySQLControlSettingsModel struct { +// IntegrationRuntimeResource integration runtime resource type. +type IntegrationRuntimeResource 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} + // Properties - Integration runtime properties. + Properties BasicIntegrationRuntime `json:"properties,omitempty"` + // ID - READ-ONLY; The resource identifier. ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource + // Name - READ-ONLY; The resource name. 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 resource type. Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; Etag identifies change in the resource. + Etag *string `json:"etag,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 { +// 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 { @@ -1633,12 +2922,11 @@ func (miscsm *ManagedIdentitySQLControlSettingsModel) UnmarshalJSON(body []byte) switch k { case "properties": if v != nil { - var managedIdentitySQLControlSettingsModelProperties ManagedIdentitySQLControlSettingsModelProperties - err = json.Unmarshal(*v, &managedIdentitySQLControlSettingsModelProperties) + properties, err := unmarshalBasicIntegrationRuntime(*v) if err != nil { return err } - miscsm.ManagedIdentitySQLControlSettingsModelProperties = &managedIdentitySQLControlSettingsModelProperties + irr.Properties = properties } case "id": if v != nil { @@ -1647,7 +2935,7 @@ func (miscsm *ManagedIdentitySQLControlSettingsModel) UnmarshalJSON(body []byte) if err != nil { return err } - miscsm.ID = &ID + irr.ID = &ID } case "name": if v != nil { @@ -1656,7 +2944,7 @@ func (miscsm *ManagedIdentitySQLControlSettingsModel) UnmarshalJSON(body []byte) if err != nil { return err } - miscsm.Name = &name + irr.Name = &name } case "type": if v != nil { @@ -1665,7 +2953,16 @@ func (miscsm *ManagedIdentitySQLControlSettingsModel) UnmarshalJSON(body []byte) if err != nil { return err } - miscsm.Type = &typeVar + irr.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + irr.Etag = &etag } } } @@ -1673,45 +2970,43 @@ 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"` -} - -// 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"` -} - -// 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` +// 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 MetadataSyncConfig. -func (msc MetadataSyncConfig) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for IntegrationRuntimeSsisCatalogInfo. +func (irsci IntegrationRuntimeSsisCatalogInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if msc.MetadataSyncConfigProperties != nil { - objectMap["properties"] = msc.MetadataSyncConfigProperties + 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 MetadataSyncConfig struct. -func (msc *MetadataSyncConfig) UnmarshalJSON(body []byte) error { +// 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 { @@ -1719,41 +3014,53 @@ func (msc *MetadataSyncConfig) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": + default: if v != nil { - var metadataSyncConfigProperties MetadataSyncConfigProperties - err = json.Unmarshal(*v, &metadataSyncConfigProperties) + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) if err != nil { return err } - msc.MetadataSyncConfigProperties = &metadataSyncConfigProperties + if irsci.AdditionalProperties == nil { + irsci.AdditionalProperties = make(map[string]interface{}) + } + irsci.AdditionalProperties[k] = additionalProperties } - case "id": + case "catalogServerEndpoint": if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var catalogServerEndpoint string + err = json.Unmarshal(*v, &catalogServerEndpoint) if err != nil { return err } - msc.ID = &ID + irsci.CatalogServerEndpoint = &catalogServerEndpoint } - case "name": + case "catalogAdminUserName": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var catalogAdminUserName string + err = json.Unmarshal(*v, &catalogAdminUserName) if err != nil { return err } - msc.Name = &name + irsci.CatalogAdminUserName = &catalogAdminUserName } - case "type": + case "catalogAdminPassword": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var catalogAdminPassword SecureString + err = json.Unmarshal(*v, &catalogAdminPassword) if err != nil { return err } - msc.Type = &typeVar + irsci.CatalogAdminPassword = &catalogAdminPassword + } + case "catalogPricingTier": + if v != nil { + var catalogPricingTier IntegrationRuntimeSsisCatalogPricingTier + err = json.Unmarshal(*v, &catalogPricingTier) + if err != nil { + return err + } + irsci.CatalogPricingTier = catalogPricingTier } } } @@ -1761,90 +3068,2242 @@ func (msc *MetadataSyncConfig) UnmarshalJSON(body []byte) error { 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"` -} +// 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) +} -// 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"` +// 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 } -// OperationMetaMetricDimensionSpecification what is this? -type OperationMetaMetricDimensionSpecification struct { - // DisplayName - Dimension display name - DisplayName *string `json:"displayName,omitempty"` - // Name - Dimension unique name +// 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"` - // ToBeExportedForShoebox - Whether this metric should be exported for Shoebox - ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` + // Properties - Integration runtime properties. + Properties BasicIntegrationRuntimeStatus `json:"properties,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 +// 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"` - // 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"` + // Type - READ-ONLY; The type of the resource. Ex- 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 +} + +// 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.NextLink == nil || len(to.String(ifrilr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.ifrilr) + if err != nil { + return err + } + page.ifrilr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *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(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"` +} + +// 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"` +} + +// 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"` +} + +// 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"` +} + +// 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. Ex- 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"` +} + +// 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"` +} + +// 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"` +} + +// 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. Ex- 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"` +} + +// 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. Ex- 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 +} + +// 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 +} + +// 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.NextLink == nil || len(to.String(pecl.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.pecl) + if err != nil { + return err + } + page.pecl = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *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(getNextPage func(context.Context, PrivateEndpointConnectionList) (PrivateEndpointConnectionList, error)) PrivateEndpointConnectionListPage { + return PrivateEndpointConnectionListPage{fn: getNextPage} +} + +// 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"` +} + +// 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. Ex- 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+"/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 +} + +// 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.NextLink == nil || len(to.String(plhilr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.plhilr) + if err != nil { + return err + } + page.plhilr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *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 PrivateLinkHubInfoListResultPage) NotDone() bool { + return !page.plhilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +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 PrivateLinkHubInfoListResultPage) Values() []PrivateLinkHub { + if page.plhilr.IsEmpty() { + return nil + } + 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} +} + +// PrivateLinkHubPatchInfo privateLinkHub patch details +type PrivateLinkHubPatchInfo struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// 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) +} + +// PrivateLinkHubProperties privateLinkHub properties +type PrivateLinkHubProperties struct { + // ProvisioningState - READ-ONLY; PrivateLinkHub provisioning state. Possible values include: 'ProvisioningState1Succeeded', 'ProvisioningState1Failed' + ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` +} + +// 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"` +} + +// 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"` +} + +// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource +// values. +type PrivateLinkResourceListResultIterator struct { + i int + page PrivateLinkResourceListResultPage +} + +// 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) + }() + } + 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 *PrivateLinkResourceListResultIterator) 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 { + 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 { + 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 { + if !iter.page.NotDone() { + return PrivateLinkResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateLinkResourceListResultIterator type. +func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator { + return PrivateLinkResourceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (plrlr PrivateLinkResourceListResult) IsEmpty() bool { + return plrlr.Value == nil || len(*plrlr.Value) == 0 +} + +// 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.NextLink == nil || len(to.String(plrlr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.plrlr) + if err != nil { + return err + } + page.plrlr = next + return nil } -// OperationMetaPropertyInfo what is this? -type OperationMetaPropertyInfo struct { - // ServiceSpecification - Operation service specification - ServiceSpecification *OperationMetaServiceSpecification `json:"serviceSpecification,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 *PrivateLinkResourceListResultPage) Next() error { + return page.NextWithContext(context.Background()) } -// 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"` +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateLinkResourceListResultPage) NotDone() bool { + return !page.plrlr.IsEmpty() } -// OperationResource an operation -type OperationResource struct { - // 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"` +// 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"` +} + +// 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"` } // ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than @@ -2391,54 +5850,506 @@ 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 +// 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 +} + +// 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 +} + +// AsBasicSecretBase is the BasicSecretBase implementation for SecureString. +func (ss SecureString) AsBasicSecretBase() (BasicSecretBase, bool) { + return &ss, true +} + +// 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"` +} + +// 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"` +} + +// 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 shir.Description != nil { + objectMap["description"] = shir.Description + } + if shir.Type != "" { + objectMap["type"] = shir.Type + } + for k, v := range shir.AdditionalProperties { + objectMap[k] = v + } + 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 +} + +// 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 { + 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 + } + } + } + + 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"` +} + +// 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 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 + } + return json.Marshal(objectMap) +} + +// 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 { + 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 + } + } + } + + return nil } -// 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 +// 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"` +} + +// 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 } - return *page.rplr.Value + if shirstp.Links != nil { + objectMap["links"] = shirstp.Links + } + return json.Marshal(objectMap) } -// Creates a new instance of the RestorePointListResultPage type. -func NewRestorePointListResultPage(getNextPage func(context.Context, RestorePointListResult) (RestorePointListResult, error)) RestorePointListResultPage { - return RestorePointListResultPage{fn: getNextPage} +// SelfHostedIntegrationRuntimeTypeProperties the self-hosted integration runtime properties. +type SelfHostedIntegrationRuntimeTypeProperties struct { + LinkedInfo BasicLinkedIntegrationRuntimeType `json:"linkedInfo,omitempty"` } -// 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"` -} +// 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 + } + } + } -// 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"` + return nil } // SensitivityLabel a sensitivity label. @@ -4925,6 +8836,543 @@ func (future *SQLPoolVulnerabilityAssessmentScansInitiateScanFuture) Result(clie return } +// SsisEnvironment ssis environment. +type SsisEnvironment struct { + // FolderID - Folder id which contains environment. + FolderID *int64 `json:"folderId,omitempty"` + // Variables - Variable in environment + Variables *[]SsisVariable `json:"variables,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 SsisEnvironment. +func (se SsisEnvironment) MarshalJSON() ([]byte, error) { + se.Type = TypeEnvironment + objectMap := make(map[string]interface{}) + if se.FolderID != nil { + objectMap["folderId"] = se.FolderID + } + if se.Variables != nil { + objectMap["variables"] = se.Variables + } + if se.ID != nil { + objectMap["id"] = se.ID + } + if se.Name != nil { + objectMap["name"] = se.Name + } + if se.Description != nil { + objectMap["description"] = se.Description + } + if se.Type != "" { + objectMap["type"] = se.Type + } + return json.Marshal(objectMap) +} + +// AsSsisFolder is the BasicSsisObjectMetadata implementation for SsisEnvironment. +func (se SsisEnvironment) AsSsisFolder() (*SsisFolder, bool) { + return nil, false +} + +// AsSsisProject is the BasicSsisObjectMetadata implementation for SsisEnvironment. +func (se SsisEnvironment) AsSsisProject() (*SsisProject, bool) { + return nil, false +} + +// AsSsisPackage is the BasicSsisObjectMetadata implementation for SsisEnvironment. +func (se SsisEnvironment) AsSsisPackage() (*SsisPackage, bool) { + return nil, false +} + +// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisEnvironment. +func (se SsisEnvironment) AsSsisEnvironment() (*SsisEnvironment, bool) { + return &se, true +} + +// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisEnvironment. +func (se SsisEnvironment) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) { + return nil, false +} + +// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisEnvironment. +func (se SsisEnvironment) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) { + return &se, true +} + +// SsisEnvironmentReference ssis environment reference. +type SsisEnvironmentReference struct { + // ID - Environment reference id. + ID *int64 `json:"id,omitempty"` + // EnvironmentFolderName - Environment folder name. + EnvironmentFolderName *string `json:"environmentFolderName,omitempty"` + // EnvironmentName - Environment name. + EnvironmentName *string `json:"environmentName,omitempty"` + // ReferenceType - Reference type + ReferenceType *string `json:"referenceType,omitempty"` +} + +// SsisFolder ssis folder. +type SsisFolder 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"` +} + +// MarshalJSON is the custom marshaler for SsisFolder. +func (sf SsisFolder) MarshalJSON() ([]byte, error) { + sf.Type = TypeFolder + objectMap := make(map[string]interface{}) + if sf.ID != nil { + objectMap["id"] = sf.ID + } + if sf.Name != nil { + objectMap["name"] = sf.Name + } + if sf.Description != nil { + objectMap["description"] = sf.Description + } + if sf.Type != "" { + objectMap["type"] = sf.Type + } + return json.Marshal(objectMap) +} + +// 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 SsisPackage. +func (sp SsisPackage) AsSsisProject() (*SsisProject, 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 SsisPackage. +func (sp SsisPackage) AsSsisEnvironment() (*SsisEnvironment, bool) { + return nil, false +} + +// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisPackage. +func (sp SsisPackage) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) { + return nil, false +} + +// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisPackage. +func (sp SsisPackage) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) { + return &sp, true +} + +// 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"` +} + +// 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"` +} + +// 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 + } + 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 SsisProject. +func (sp SsisProject) AsSsisFolder() (*SsisFolder, bool) { + return nil, false +} + +// 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 +} + +// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisProject. +func (sp SsisProject) AsSsisEnvironment() (*SsisEnvironment, bool) { + return nil, false +} + +// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisProject. +func (sp SsisProject) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) { + return nil, false +} + +// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisProject. +func (sp SsisProject) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) { + return &sp, 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 factory. +type SubResource struct { + // ID - READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; Etag identifies change in the resource. + Etag *string `json:"etag,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' @@ -5067,6 +9515,20 @@ type TransparentDataEncryptionProperties struct { 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 @@ -5799,7 +10261,7 @@ type WorkspaceProperties struct { DefaultDataLakeStorage *DataLakeStorageAccountDetails `json:"defaultDataLakeStorage,omitempty"` // SQLAdministratorLoginPassword - SQL administrator login password SQLAdministratorLoginPassword *string `json:"sqlAdministratorLoginPassword,omitempty"` - // ManagedResourceGroupName - READ-ONLY; Workspace managed resource group + // ManagedResourceGroupName - Workspace managed resource group. The resource group name uniquely identifies the resource group within the user subscriptionId. The resource group name must be no longer than 90 characters long, and must be alphanumeric characters (Char.IsLetterOrDigit()) and '-', '_', '(', ')' and'.'. Note that the name cannot end with '.' ManagedResourceGroupName *string `json:"managedResourceGroupName,omitempty"` // ProvisioningState - READ-ONLY; Resource provisioning state ProvisioningState *string `json:"provisioningState,omitempty"` @@ -5809,6 +10271,10 @@ type WorkspaceProperties struct { VirtualNetworkProfile *VirtualNetworkProfile `json:"virtualNetworkProfile,omitempty"` // ConnectivityEndpoints - Connectivity endpoints ConnectivityEndpoints map[string]*string `json:"connectivityEndpoints"` + // ManagedVirtualNetwork - Setting this to 'default' will ensure that all compute for this workspace is in a virtual network managed on behalf of the user. + ManagedVirtualNetwork *string `json:"managedVirtualNetwork,omitempty"` + // PrivateEndpointConnections - Private endpoint connections to the workspace + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` } // MarshalJSON is the custom marshaler for WorkspaceProperties. @@ -5820,6 +10286,9 @@ func (wp WorkspaceProperties) MarshalJSON() ([]byte, error) { if wp.SQLAdministratorLoginPassword != nil { objectMap["sqlAdministratorLoginPassword"] = wp.SQLAdministratorLoginPassword } + if wp.ManagedResourceGroupName != nil { + objectMap["managedResourceGroupName"] = wp.ManagedResourceGroupName + } if wp.SQLAdministratorLogin != nil { objectMap["sqlAdministratorLogin"] = wp.SQLAdministratorLogin } @@ -5829,6 +10298,12 @@ func (wp WorkspaceProperties) MarshalJSON() ([]byte, error) { if wp.ConnectivityEndpoints != nil { objectMap["connectivityEndpoints"] = wp.ConnectivityEndpoints } + if wp.ManagedVirtualNetwork != nil { + objectMap["managedVirtualNetwork"] = wp.ManagedVirtualNetwork + } + if wp.PrivateEndpointConnections != nil { + objectMap["privateEndpointConnections"] = wp.PrivateEndpointConnections + } return json.Marshal(objectMap) } 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 40f7dea1419a..5273e87a6235 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 @@ -115,7 +115,6 @@ func (client OperationsClient) CheckNameAvailabilitySender(req *http.Request) (* func (client OperationsClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -203,7 +202,6 @@ func (client OperationsClient) GetAzureAsyncHeaderResultSender(req *http.Request func (client OperationsClient) GetAzureAsyncHeaderResultResponder(resp *http.Response) (result SetObject, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound, http.StatusInternalServerError), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -291,7 +289,6 @@ func (client OperationsClient) GetLocationHeaderResultSender(req *http.Request) func (client OperationsClient) GetLocationHeaderResultResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -351,7 +348,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result ListAvailableRpOperation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) 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 new file mode 100644 index 000000000000..ccfe4fb06ccf --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privateendpointconnections.go @@ -0,0 +1,428 @@ +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" +) + +// PrivateEndpointConnectionsClient is the azure Synapse Analytics Management Client +type PrivateEndpointConnectionsClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient 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 NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create approve or reject a private endpoint connection. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Create") + 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.PrivateEndpointConnectionsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client PrivateEndpointConnectionsClient) CreatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "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.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) CreateSender(req *http.Request) (future PrivateEndpointConnectionsCreateFuture, 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 +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) CreateResponder(resp *http.Response) (result PrivateEndpointConnection, 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 delete a private endpoint connection. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// 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() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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.PrivateEndpointConnectionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "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}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, 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 PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result OperationResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// 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 +// 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() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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.PrivateEndpointConnectionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsClient", "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.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "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}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionsClient) 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 PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// 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 +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") + defer func() { + sc := -1 + if result.pecl.Response.Response != nil { + sc = result.pecl.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.PrivateEndpointConnectionsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pecl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsClient", "List", resp, "Failure sending request") + return + } + + result.pecl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateEndpointConnectionsClient) 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}/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 PrivateEndpointConnectionsClient) 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 PrivateEndpointConnectionsClient) ListResponder(resp *http.Response) (result PrivateEndpointConnectionList, 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 PrivateEndpointConnectionsClient) listNextResults(ctx context.Context, lastResults PrivateEndpointConnectionList) (result PrivateEndpointConnectionList, err error) { + req, err := lastResults.privateEndpointConnectionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsClient", "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.PrivateEndpointConnectionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateEndpointConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result PrivateEndpointConnectionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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/privatelinkhubs.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privatelinkhubs.go new file mode 100644 index 000000000000..4bff82d937e0 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privatelinkhubs.go @@ -0,0 +1,623 @@ +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" +) + +// PrivateLinkHubsClient is the azure Synapse Analytics Management Client +type PrivateLinkHubsClient struct { + BaseClient +} + +// NewPrivateLinkHubsClient creates an instance of the PrivateLinkHubsClient client. +func NewPrivateLinkHubsClient(subscriptionID string) PrivateLinkHubsClient { + return NewPrivateLinkHubsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkHubsClientWithBaseURI creates an instance of the PrivateLinkHubsClient 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 NewPrivateLinkHubsClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkHubsClient { + return PrivateLinkHubsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.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.PrivateLinkHubsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, privateLinkHubName, privateLinkHubInfo) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "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.PrivateLinkHubsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PrivateLinkHubsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, privateLinkHubName string, privateLinkHubInfo PrivateLinkHub) (*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.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName}", pathParameters), + autorest.WithJSON(privateLinkHubInfo), + 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 PrivateLinkHubsClient) 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 PrivateLinkHubsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateLinkHub, 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 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.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.PrivateLinkHubsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, privateLinkHubName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Delete", resp, "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 +} + +// DeletePreparer prepares the Delete request. +func (client PrivateLinkHubsClient) DeletePreparer(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.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName}", 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 PrivateLinkHubsClient) 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 PrivateLinkHubsClient) 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 gets a privateLinkHub +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// privateLinkHubName - the 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") + 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.PrivateLinkHubsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, privateLinkHubName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "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.PrivateLinkHubsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateLinkHubsClient) GetPreparer(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}", 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 PrivateLinkHubsClient) 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 PrivateLinkHubsClient) GetResponder(resp *http.Response) (result PrivateLinkHub, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List returns a list of privateLinkHubs in a subscription +func (client PrivateLinkHubsClient) List(ctx context.Context) (result PrivateLinkHubInfoListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.List") + defer func() { + sc := -1 + if result.plhilr.Response.Response != nil { + sc = result.plhilr.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}}}}); err != nil { + return result, validation.NewError("synapse.PrivateLinkHubsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.plhilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "List", resp, "Failure sending request") + return + } + + result.plhilr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateLinkHubsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "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}/providers/Microsoft.Synapse/privateLinkHubs", 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 PrivateLinkHubsClient) 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 PrivateLinkHubsClient) ListResponder(resp *http.Response) (result PrivateLinkHubInfoListResult, 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 PrivateLinkHubsClient) listNextResults(ctx context.Context, lastResults PrivateLinkHubInfoListResult) (result PrivateLinkHubInfoListResult, err error) { + req, err := lastResults.privateLinkHubInfoListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "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.PrivateLinkHubsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateLinkHubsClient) ListComplete(ctx context.Context) (result PrivateLinkHubInfoListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup returns a list of privateLinkHubs in a resource group +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client PrivateLinkHubsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result PrivateLinkHubInfoListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.plhilr.Response.Response != nil { + sc = result.plhilr.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.PrivateLinkHubsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.plhilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.plhilr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client PrivateLinkHubsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "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/privateLinkHub", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkHubsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client PrivateLinkHubsClient) ListByResourceGroupResponder(resp *http.Response) (result PrivateLinkHubInfoListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client PrivateLinkHubsClient) listByResourceGroupNextResults(ctx context.Context, lastResults PrivateLinkHubInfoListResult) (result PrivateLinkHubInfoListResult, err error) { + req, err := lastResults.privateLinkHubInfoListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateLinkHubsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result PrivateLinkHubInfoListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.ListByResourceGroup") + 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.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.Update") + 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.PrivateLinkHubsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, privateLinkHubName, privateLinkHubPatchInfo) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PrivateLinkHubsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, privateLinkHubName string, privateLinkHubPatchInfo PrivateLinkHubPatchInfo) (*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.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName}", pathParameters), + autorest.WithJSON(privateLinkHubPatchInfo), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkHubsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client PrivateLinkHubsClient) UpdateResponder(resp *http.Response) (result PrivateLinkHub, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privatelinkresources.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privatelinkresources.go new file mode 100644 index 000000000000..1bedde90c097 --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privatelinkresources.go @@ -0,0 +1,254 @@ +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" +) + +// PrivateLinkResourcesClient is the azure Synapse Analytics Management Client +type PrivateLinkResourcesClient struct { + BaseClient +} + +// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient 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 NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get private link resource in workspace +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// privateLinkResourceName - the name of the private link resource +func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, privateLinkResourceName string) (result PrivateLinkResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.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.PrivateLinkResourcesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, privateLinkResourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkResourcesClient", "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.PrivateLinkResourcesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkResourcesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateLinkResourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateLinkResourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateLinkResourceName": autorest.Encode("path", privateLinkResourceName), + "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}/privateLinkResources/{privateLinkResourceName}", 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 PrivateLinkResourcesClient) 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 PrivateLinkResourcesClient) GetResponder(resp *http.Response) (result PrivateLinkResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List get all private link resources for a workspaces +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result PrivateLinkResourceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.List") + defer func() { + sc := -1 + if result.plrlr.Response.Response != nil { + sc = result.plrlr.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.PrivateLinkResourcesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkResourcesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.plrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkResourcesClient", "List", resp, "Failure sending request") + return + } + + result.plrlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkResourcesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateLinkResourcesClient) 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}/privateLinkResources", 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 PrivateLinkResourcesClient) 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 PrivateLinkResourcesClient) ListResponder(resp *http.Response) (result PrivateLinkResourceListResult, 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 PrivateLinkResourcesClient) listNextResults(ctx context.Context, lastResults PrivateLinkResourceListResult) (result PrivateLinkResourceListResult, err error) { + req, err := lastResults.privateLinkResourceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.PrivateLinkResourcesClient", "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.PrivateLinkResourcesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkResourcesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateLinkResourcesClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result PrivateLinkResourceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.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/sqlpoolblobauditingpolicies.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolblobauditingpolicies.go index 5b87612685cb..c0fa9be19cdd 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 @@ -128,7 +128,6 @@ func (client SQLPoolBlobAuditingPoliciesClient) CreateOrUpdateSender(req *http.R func (client SQLPoolBlobAuditingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result SQLPoolBlobAuditingPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -217,7 +216,6 @@ func (client SQLPoolBlobAuditingPoliciesClient) GetSender(req *http.Request) (*h func (client SQLPoolBlobAuditingPoliciesClient) GetResponder(resp *http.Response) (result SQLPoolBlobAuditingPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolconnectionpolicies.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolconnectionpolicies.go index 2971c7de37a6..2e02234cacec 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolconnectionpolicies.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolconnectionpolicies.go @@ -124,7 +124,6 @@ func (client SQLPoolConnectionPoliciesClient) GetSender(req *http.Request) (*htt func (client SQLPoolConnectionPoliciesClient) GetResponder(resp *http.Response) (result SQLPoolConnectionPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooldatawarehouseuseractivities.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooldatawarehouseuseractivities.go index 74b4141e95a5..3ad9fa1f1cb1 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooldatawarehouseuseractivities.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooldatawarehouseuseractivities.go @@ -125,7 +125,6 @@ func (client SQLPoolDataWarehouseUserActivitiesClient) GetSender(req *http.Reque func (client SQLPoolDataWarehouseUserActivitiesClient) GetResponder(resp *http.Response) (result DataWarehouseUserActivities, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) 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 7edf02057d8c..8958c13706b1 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 @@ -124,7 +124,6 @@ func (client SQLPoolGeoBackupPoliciesClient) GetSender(req *http.Request) (*http func (client SQLPoolGeoBackupPoliciesClient) GetResponder(resp *http.Response) (result GeoBackupPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolmetadatasyncconfigs.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolmetadatasyncconfigs.go index 505ced48fd0a..007da50154fc 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolmetadatasyncconfigs.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolmetadatasyncconfigs.go @@ -126,7 +126,6 @@ func (client SQLPoolMetadataSyncConfigsClient) CreateSender(req *http.Request) ( func (client SQLPoolMetadataSyncConfigsClient) CreateResponder(resp *http.Response) (result MetadataSyncConfig, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -214,7 +213,6 @@ func (client SQLPoolMetadataSyncConfigsClient) GetSender(req *http.Request) (*ht func (client SQLPoolMetadataSyncConfigsClient) GetResponder(resp *http.Response) (result MetadataSyncConfig, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) 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 e476d03e4c04..0fb3a590825c 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,6 @@ func (client SQLPoolOperationResultsClient) GetLocationHeaderResultSender(req *h func (client SQLPoolOperationResultsClient) GetLocationHeaderResultResponder(resp *http.Response) (result SetObject, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooloperations.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooloperations.go index 8929da54a14e..821d428a65c8 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooloperations.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooloperations.go @@ -124,7 +124,6 @@ func (client SQLPoolOperationsClient) ListSender(req *http.Request) (*http.Respo func (client SQLPoolOperationsClient) ListResponder(resp *http.Response) (result SQLPoolBlobAuditingPolicySQLPoolOperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) 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 5a97c67160f7..172a27c124fd 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 @@ -124,7 +124,6 @@ func (client SQLPoolReplicationLinksClient) ListSender(req *http.Request) (*http func (client SQLPoolReplicationLinksClient) ListResponder(resp *http.Response) (result ReplicationLinkListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) 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 e229d1bca231..bfbdd87ee35b 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 @@ -128,7 +128,6 @@ func (client SQLPoolRestorePointsClient) CreateSender(req *http.Request) (future func (client SQLPoolRestorePointsClient) CreateResponder(resp *http.Response) (result RestorePoint, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -217,7 +216,6 @@ func (client SQLPoolRestorePointsClient) ListSender(req *http.Request) (*http.Re func (client SQLPoolRestorePointsClient) ListResponder(resp *http.Response) (result RestorePointListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) 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 c17d10e5ef48..2545ebb6dddc 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 @@ -125,7 +125,6 @@ func (client SQLPoolsClient) CreateSender(req *http.Request) (future SQLPoolsCre func (client SQLPoolsClient) CreateResponder(resp *http.Response) (result SQLPool, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -213,7 +212,6 @@ func (client SQLPoolsClient) DeleteSender(req *http.Request) (future SQLPoolsDel func (client SQLPoolsClient) DeleteResponder(resp *http.Response) (result SetObject, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -301,7 +299,6 @@ func (client SQLPoolsClient) GetSender(req *http.Request) (*http.Response, error func (client SQLPoolsClient) GetResponder(resp *http.Response) (result SQLPool, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -388,7 +385,6 @@ func (client SQLPoolsClient) ListByWorkspaceSender(req *http.Request) (*http.Res func (client SQLPoolsClient) ListByWorkspaceResponder(resp *http.Response) (result SQLPoolInfoListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -513,7 +509,6 @@ func (client SQLPoolsClient) PauseSender(req *http.Request) (future SQLPoolsPaus func (client SQLPoolsClient) PauseResponder(resp *http.Response) (result SetObject, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -606,7 +601,6 @@ func (client SQLPoolsClient) RenameSender(req *http.Request) (*http.Response, er func (client SQLPoolsClient) RenameResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -693,7 +687,6 @@ func (client SQLPoolsClient) ResumeSender(req *http.Request) (future SQLPoolsRes func (client SQLPoolsClient) ResumeResponder(resp *http.Response) (result SetObject, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -784,8 +777,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, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 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 3d66a13b5de6..e67d60cb688d 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 @@ -127,7 +127,6 @@ func (client SQLPoolSchemasClient) ListSender(req *http.Request) (*http.Response func (client SQLPoolSchemasClient) ListResponder(resp *http.Response) (result SQLPoolSchemaListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) 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 ea1e33860e02..454fea827d59 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 @@ -127,7 +127,6 @@ func (client SQLPoolSecurityAlertPoliciesClient) CreateOrUpdateSender(req *http. func (client SQLPoolSecurityAlertPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result SQLPoolSecurityAlertPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -216,7 +215,6 @@ func (client SQLPoolSecurityAlertPoliciesClient) GetSender(req *http.Request) (* func (client SQLPoolSecurityAlertPoliciesClient) GetResponder(resp *http.Response) (result SQLPoolSecurityAlertPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) 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 5ec03938e422..aac522be1a6f 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 @@ -133,7 +133,6 @@ func (client SQLPoolSensitivityLabelsClient) CreateOrUpdateSender(req *http.Requ func (client SQLPoolSensitivityLabelsClient) CreateOrUpdateResponder(resp *http.Response) (result SensitivityLabel, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -228,7 +227,6 @@ func (client SQLPoolSensitivityLabelsClient) DeleteSender(req *http.Request) (*h func (client SQLPoolSensitivityLabelsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -322,7 +320,6 @@ func (client SQLPoolSensitivityLabelsClient) DisableRecommendationSender(req *ht func (client SQLPoolSensitivityLabelsClient) DisableRecommendationResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -417,7 +414,6 @@ func (client SQLPoolSensitivityLabelsClient) EnableRecommendationSender(req *htt func (client SQLPoolSensitivityLabelsClient) EnableRecommendationResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -509,7 +505,6 @@ func (client SQLPoolSensitivityLabelsClient) ListCurrentSender(req *http.Request func (client SQLPoolSensitivityLabelsClient) ListCurrentResponder(resp *http.Response) (result SensitivityLabelListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -647,7 +642,6 @@ func (client SQLPoolSensitivityLabelsClient) ListRecommendedSender(req *http.Req func (client SQLPoolSensitivityLabelsClient) ListRecommendedResponder(resp *http.Response) (result SensitivityLabelListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooltablecolumns.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooltablecolumns.go index 2766e012785f..bde6d1b2f2b1 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooltablecolumns.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpooltablecolumns.go @@ -132,7 +132,6 @@ func (client SQLPoolTableColumnsClient) ListByTableNameSender(req *http.Request) func (client SQLPoolTableColumnsClient) ListByTableNameResponder(resp *http.Response) (result SQLPoolColumnListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) 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 1f845f79d044..dccfd1d3626f 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 @@ -129,7 +129,6 @@ func (client SQLPoolTablesClient) ListBySchemaSender(req *http.Request) (*http.R func (client SQLPoolTablesClient) ListBySchemaResponder(resp *http.Response) (result SQLPoolTableListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) 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 534c054ef2c4..c7d9110887a6 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 @@ -129,7 +129,6 @@ func (client SQLPoolTransparentDataEncryptionsClient) CreateOrUpdateSender(req * func (client SQLPoolTransparentDataEncryptionsClient) CreateOrUpdateResponder(resp *http.Response) (result TransparentDataEncryption, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -218,7 +217,6 @@ func (client SQLPoolTransparentDataEncryptionsClient) GetSender(req *http.Reques func (client SQLPoolTransparentDataEncryptionsClient) GetResponder(resp *http.Response) (result TransparentDataEncryption, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolusages.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolusages.go index df7d90632fa0..728aa2c7a5ef 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolusages.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/sqlpoolusages.go @@ -123,7 +123,6 @@ func (client SQLPoolUsagesClient) ListSender(req *http.Request) (*http.Response, func (client SQLPoolUsagesClient) ListResponder(resp *http.Response) (result SQLPoolUsageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) 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 30f9b2d54d6f..d3985e125a80 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 @@ -136,7 +136,6 @@ func (client SQLPoolVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdateSe func (client SQLPoolVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdateResponder(resp *http.Response) (result SQLPoolVulnerabilityAssessmentRuleBaseline, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -230,7 +229,6 @@ func (client SQLPoolVulnerabilityAssessmentRuleBaselinesClient) DeleteSender(req func (client SQLPoolVulnerabilityAssessmentRuleBaselinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp 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 e3cbdccec27c..e7a65af71116 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 @@ -127,7 +127,6 @@ func (client SQLPoolVulnerabilityAssessmentsClient) CreateOrUpdateSender(req *ht func (client SQLPoolVulnerabilityAssessmentsClient) CreateOrUpdateResponder(resp *http.Response) (result SQLPoolVulnerabilityAssessment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -216,7 +215,6 @@ func (client SQLPoolVulnerabilityAssessmentsClient) DeleteSender(req *http.Reque func (client SQLPoolVulnerabilityAssessmentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -304,7 +302,6 @@ func (client SQLPoolVulnerabilityAssessmentsClient) GetSender(req *http.Request) func (client SQLPoolVulnerabilityAssessmentsClient) GetResponder(resp *http.Response) (result SQLPoolVulnerabilityAssessment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -393,7 +390,6 @@ func (client SQLPoolVulnerabilityAssessmentsClient) ListSender(req *http.Request func (client SQLPoolVulnerabilityAssessmentsClient) ListResponder(resp *http.Response) (result SQLPoolVulnerabilityAssessmentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) 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 0200438ed8fa..54a680a510a9 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 @@ -127,7 +127,6 @@ func (client SQLPoolVulnerabilityAssessmentScansClient) ExportSender(req *http.R func (client SQLPoolVulnerabilityAssessmentScansClient) ExportResponder(resp *http.Response) (result SQLPoolVulnerabilityAssessmentScansExport, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -218,7 +217,6 @@ func (client SQLPoolVulnerabilityAssessmentScansClient) InitiateScanSender(req * func (client SQLPoolVulnerabilityAssessmentScansClient) InitiateScanResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -307,7 +305,6 @@ func (client SQLPoolVulnerabilityAssessmentScansClient) ListSender(req *http.Req func (client SQLPoolVulnerabilityAssessmentScansClient) ListResponder(resp *http.Response) (result VulnerabilityAssessmentScanRecordListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) 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 dbaeecc06738..45ee27be2802 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 @@ -49,6 +49,7 @@ var _ OperationsClientAPI = (*synapse.OperationsClient)(nil) type IPFirewallRulesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string, IPFirewallRuleInfo synapse.IPFirewallRuleInfo) (result synapse.IPFirewallRulesCreateOrUpdateFuture, err error) Delete(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string) (result synapse.IPFirewallRulesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string) (result synapse.IPFirewallRuleInfo, err error) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.IPFirewallRuleInfoListResultPage, err error) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.IPFirewallRuleInfoListResultIterator, err error) ReplaceAll(ctx context.Context, resourceGroupName string, workspaceName string, request synapse.ReplaceAllIPFirewallRulesRequest) (result synapse.IPFirewallRulesReplaceAllFuture, err error) @@ -261,3 +262,112 @@ type WorkspaceManagedIdentitySQLControlSettingsClientAPI interface { } var _ WorkspaceManagedIdentitySQLControlSettingsClientAPI = (*synapse.WorkspaceManagedIdentitySQLControlSettingsClient)(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.IntegrationRuntimeResource, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result autorest.Response, 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) + 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) +} + +var _ IntegrationRuntimesClientAPI = (*synapse.IntegrationRuntimesClient)(nil) + +// IntegrationRuntimeNodeIPAddressClientAPI contains the set of methods on the IntegrationRuntimeNodeIPAddressClient type. +type IntegrationRuntimeNodeIPAddressClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, nodeName string) (result synapse.IntegrationRuntimeNodeIPAddress, err error) +} + +var _ IntegrationRuntimeNodeIPAddressClientAPI = (*synapse.IntegrationRuntimeNodeIPAddressClient)(nil) + +// 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) +} + +var _ IntegrationRuntimeObjectMetadataClientAPI = (*synapse.IntegrationRuntimeObjectMetadataClient)(nil) + +// IntegrationRuntimeNodesClientAPI contains the set of methods on the IntegrationRuntimeNodesClient type. +type IntegrationRuntimeNodesClientAPI interface { + Delete(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, nodeName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, nodeName string) (result synapse.SelfHostedIntegrationRuntimeNode, err error) + Update(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, nodeName string, updateIntegrationRuntimeNodeRequest synapse.UpdateIntegrationRuntimeNodeRequest) (result synapse.SelfHostedIntegrationRuntimeNode, err error) +} + +var _ IntegrationRuntimeNodesClientAPI = (*synapse.IntegrationRuntimeNodesClient)(nil) + +// IntegrationRuntimeCredentialsClientAPI contains the set of methods on the IntegrationRuntimeCredentialsClient type. +type IntegrationRuntimeCredentialsClientAPI interface { + Sync(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result autorest.Response, err error) +} + +var _ IntegrationRuntimeCredentialsClientAPI = (*synapse.IntegrationRuntimeCredentialsClient)(nil) + +// IntegrationRuntimeConnectionInfosClientAPI contains the set of methods on the IntegrationRuntimeConnectionInfosClient type. +type IntegrationRuntimeConnectionInfosClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result synapse.IntegrationRuntimeConnectionInfo, err error) +} + +var _ IntegrationRuntimeConnectionInfosClientAPI = (*synapse.IntegrationRuntimeConnectionInfosClient)(nil) + +// IntegrationRuntimeAuthKeysClientAPI contains the set of methods on the IntegrationRuntimeAuthKeysClient type. +type IntegrationRuntimeAuthKeysClientAPI interface { + List(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result synapse.IntegrationRuntimeAuthKeys, err error) + Regenerate(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string, regenerateKeyParameters synapse.IntegrationRuntimeRegenerateKeyParameters) (result synapse.IntegrationRuntimeAuthKeys, err error) +} + +var _ IntegrationRuntimeAuthKeysClientAPI = (*synapse.IntegrationRuntimeAuthKeysClient)(nil) + +// 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) +} + +var _ IntegrationRuntimeMonitoringDataClientAPI = (*synapse.IntegrationRuntimeMonitoringDataClient)(nil) + +// IntegrationRuntimeStatusClientAPI contains the set of methods on the IntegrationRuntimeStatusClient type. +type IntegrationRuntimeStatusClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workspaceName string, integrationRuntimeName string) (result synapse.IntegrationRuntimeStatusResponse, err error) +} + +var _ IntegrationRuntimeStatusClientAPI = (*synapse.IntegrationRuntimeStatusClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workspaceName string, privateLinkResourceName string) (result synapse.PrivateLinkResource, err error) + List(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.PrivateLinkResourceListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.PrivateLinkResourceListResultIterator, err error) +} + +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) + 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) + ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result synapse.PrivateEndpointConnectionListIterator, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*synapse.PrivateEndpointConnectionsClient)(nil) + +// 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) + 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) +} + +var _ PrivateLinkHubsClientAPI = (*synapse.PrivateLinkHubsClient)(nil) diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/version.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/version.go index 239b58388afd..6817c93c7a3b 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/version.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " synapse/2019-06-01-preview" + return "Azure-SDK-For-Go/" + Version() + " synapse/2019-06-01-preview" } // Version returns the semantic version (see http://semver.org) of the client. 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 1e1bb1f819f0..910564814e84 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 @@ -124,7 +124,6 @@ func (client WorkspaceAadAdminsClient) CreateOrUpdateSender(req *http.Request) ( func (client WorkspaceAadAdminsClient) CreateOrUpdateResponder(resp *http.Response) (result WorkspaceAadAdminInfo, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -210,7 +209,6 @@ 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, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -295,7 +293,6 @@ func (client WorkspaceAadAdminsClient) GetSender(req *http.Request) (*http.Respo func (client WorkspaceAadAdminsClient) GetResponder(resp *http.Response) (result WorkspaceAadAdminInfo, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedidentitysqlcontrolsettings.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedidentitysqlcontrolsettings.go index ec129a4553c0..16c460abd2f1 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedidentitysqlcontrolsettings.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspacemanagedidentitysqlcontrolsettings.go @@ -125,7 +125,6 @@ func (client WorkspaceManagedIdentitySQLControlSettingsClient) CreateOrUpdateSen func (client WorkspaceManagedIdentitySQLControlSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedIdentitySQLControlSettingsModel, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -211,7 +210,6 @@ func (client WorkspaceManagedIdentitySQLControlSettingsClient) GetSender(req *ht func (client WorkspaceManagedIdentitySQLControlSettingsClient) GetResponder(resp *http.Response) (result ManagedIdentitySQLControlSettingsModel, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspaces.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspaces.go index 77f1a8b62566..88a37ee30c88 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspaces.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/workspaces.go @@ -123,7 +123,6 @@ func (client WorkspacesClient) CreateOrUpdateSender(req *http.Request) (future W func (client WorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (result Workspace, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -209,7 +208,6 @@ func (client WorkspacesClient) DeleteSender(req *http.Request) (future Workspace func (client WorkspacesClient) DeleteResponder(resp *http.Response) (result SetObject, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -295,7 +293,6 @@ func (client WorkspacesClient) GetSender(req *http.Request) (*http.Response, err func (client WorkspacesClient) GetResponder(resp *http.Response) (result Workspace, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -373,7 +370,6 @@ func (client WorkspacesClient) ListSender(req *http.Request) (*http.Response, er func (client WorkspacesClient) ListResponder(resp *http.Response) (result WorkspaceInfoListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -495,7 +491,6 @@ func (client WorkspacesClient) ListByResourceGroupSender(req *http.Request) (*ht func (client WorkspacesClient) ListByResourceGroupResponder(resp *http.Response) (result WorkspaceInfoListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -621,7 +616,6 @@ func (client WorkspacesClient) UpdateSender(req *http.Request) (future Workspace func (client WorkspacesClient) UpdateResponder(resp *http.Response) (result Workspace, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing())