diff --git a/profiles/preview/preview/sql/mgmt/sql/models.go b/profiles/preview/preview/sql/mgmt/sql/models.go index 6cf9cb68b154..f6a225474230 100644 --- a/profiles/preview/preview/sql/mgmt/sql/models.go +++ b/profiles/preview/preview/sql/mgmt/sql/models.go @@ -35,8 +35,7 @@ type DatabaseVulnerabilityAssessmentScansClient = original.DatabaseVulnerability type ElasticPoolOperationsClient = original.ElasticPoolOperationsClient type ElasticPoolsClient = original.ElasticPoolsClient type InstanceFailoverGroupsClient = original.InstanceFailoverGroupsClient -type ManagedInstanceEncryptionProtectorsClient = original.ManagedInstanceEncryptionProtectorsClient -type ManagedInstanceKeysClient = original.ManagedInstanceKeysClient +type InterfaceEndpointProfilesClient = original.InterfaceEndpointProfilesClient type ManagedInstanceTdeCertificatesClient = original.ManagedInstanceTdeCertificatesClient type CapabilityGroup = original.CapabilityGroup @@ -136,6 +135,17 @@ const ( Secondary InstanceFailoverGroupReplicationRole = original.Secondary ) +type InterfaceEndpointProfileStateType = original.InterfaceEndpointProfileStateType + +const ( + Deleting InterfaceEndpointProfileStateType = original.Deleting + Failed InterfaceEndpointProfileStateType = original.Failed + Initializing InterfaceEndpointProfileStateType = original.Initializing + InProgress InterfaceEndpointProfileStateType = original.InProgress + Ready InterfaceEndpointProfileStateType = original.Ready + Unknown InterfaceEndpointProfileStateType = original.Unknown +) + type LogSizeUnit = original.LogSizeUnit const ( @@ -149,12 +159,12 @@ const ( type ManagementOperationState = original.ManagementOperationState const ( - CancelInProgress ManagementOperationState = original.CancelInProgress - Cancelled ManagementOperationState = original.Cancelled - Failed ManagementOperationState = original.Failed - InProgress ManagementOperationState = original.InProgress - Pending ManagementOperationState = original.Pending - Succeeded ManagementOperationState = original.Succeeded + ManagementOperationStateCancelInProgress ManagementOperationState = original.ManagementOperationStateCancelInProgress + ManagementOperationStateCancelled ManagementOperationState = original.ManagementOperationStateCancelled + ManagementOperationStateFailed ManagementOperationState = original.ManagementOperationStateFailed + ManagementOperationStateInProgress ManagementOperationState = original.ManagementOperationStateInProgress + ManagementOperationStatePending ManagementOperationState = original.ManagementOperationStatePending + ManagementOperationStateSucceeded ManagementOperationState = original.ManagementOperationStateSucceeded ) type MaxSizeUnit = original.MaxSizeUnit @@ -195,13 +205,6 @@ const ( WideWorldImportersStd SampleName = original.WideWorldImportersStd ) -type ServerKeyType = original.ServerKeyType - -const ( - AzureKeyVault ServerKeyType = original.AzureKeyVault - ServiceManaged ServerKeyType = original.ServiceManaged -) - type VulnerabilityAssessmentScanState = original.VulnerabilityAssessmentScanState const ( @@ -277,24 +280,18 @@ type InstanceFailoverGroupsCreateOrUpdateFuture = original.InstanceFailoverGroup type InstanceFailoverGroupsDeleteFuture = original.InstanceFailoverGroupsDeleteFuture type InstanceFailoverGroupsFailoverFuture = original.InstanceFailoverGroupsFailoverFuture type InstanceFailoverGroupsForceFailoverAllowDataLossFuture = original.InstanceFailoverGroupsForceFailoverAllowDataLossFuture +type InterfaceEndpointProfile = original.InterfaceEndpointProfile +type InterfaceEndpointProfileProperties = original.InterfaceEndpointProfileProperties +type InterfaceEndpointProfilesCreateOrUpdateFuture = original.InterfaceEndpointProfilesCreateOrUpdateFuture +type InterfaceEndpointProfilesDeleteFuture = original.InterfaceEndpointProfilesDeleteFuture +type InterfaceEndpointProfilesListResult = original.InterfaceEndpointProfilesListResult +type InterfaceEndpointProfilesListResultIterator = original.InterfaceEndpointProfilesListResultIterator +type InterfaceEndpointProfilesListResultPage = original.InterfaceEndpointProfilesListResultPage type LicenseTypeCapability = original.LicenseTypeCapability type LocationCapabilities = original.LocationCapabilities type LogSizeCapability = original.LogSizeCapability type ManagedInstanceEditionCapability = original.ManagedInstanceEditionCapability -type ManagedInstanceEncryptionProtector = original.ManagedInstanceEncryptionProtector -type ManagedInstanceEncryptionProtectorListResult = original.ManagedInstanceEncryptionProtectorListResult -type ManagedInstanceEncryptionProtectorListResultIterator = original.ManagedInstanceEncryptionProtectorListResultIterator -type ManagedInstanceEncryptionProtectorListResultPage = original.ManagedInstanceEncryptionProtectorListResultPage -type ManagedInstanceEncryptionProtectorProperties = original.ManagedInstanceEncryptionProtectorProperties -type ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture = original.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture type ManagedInstanceFamilyCapability = original.ManagedInstanceFamilyCapability -type ManagedInstanceKey = original.ManagedInstanceKey -type ManagedInstanceKeyListResult = original.ManagedInstanceKeyListResult -type ManagedInstanceKeyListResultIterator = original.ManagedInstanceKeyListResultIterator -type ManagedInstanceKeyListResultPage = original.ManagedInstanceKeyListResultPage -type ManagedInstanceKeyProperties = original.ManagedInstanceKeyProperties -type ManagedInstanceKeysCreateOrUpdateFuture = original.ManagedInstanceKeysCreateOrUpdateFuture -type ManagedInstanceKeysDeleteFuture = original.ManagedInstanceKeysDeleteFuture type ManagedInstancePairInfo = original.ManagedInstancePairInfo type ManagedInstanceTdeCertificatesCreateFuture = original.ManagedInstanceTdeCertificatesCreateFuture type ManagedInstanceVcoresCapability = original.ManagedInstanceVcoresCapability @@ -376,17 +373,11 @@ func NewInstanceFailoverGroupsClient(subscriptionID string) InstanceFailoverGrou func NewInstanceFailoverGroupsClientWithBaseURI(baseURI string, subscriptionID string) InstanceFailoverGroupsClient { return original.NewInstanceFailoverGroupsClientWithBaseURI(baseURI, subscriptionID) } -func NewManagedInstanceEncryptionProtectorsClient(subscriptionID string) ManagedInstanceEncryptionProtectorsClient { - return original.NewManagedInstanceEncryptionProtectorsClient(subscriptionID) -} -func NewManagedInstanceEncryptionProtectorsClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceEncryptionProtectorsClient { - return original.NewManagedInstanceEncryptionProtectorsClientWithBaseURI(baseURI, subscriptionID) +func NewInterfaceEndpointProfilesClient(subscriptionID string) InterfaceEndpointProfilesClient { + return original.NewInterfaceEndpointProfilesClient(subscriptionID) } -func NewManagedInstanceKeysClient(subscriptionID string) ManagedInstanceKeysClient { - return original.NewManagedInstanceKeysClient(subscriptionID) -} -func NewManagedInstanceKeysClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceKeysClient { - return original.NewManagedInstanceKeysClientWithBaseURI(baseURI, subscriptionID) +func NewInterfaceEndpointProfilesClientWithBaseURI(baseURI string, subscriptionID string) InterfaceEndpointProfilesClient { + return original.NewInterfaceEndpointProfilesClientWithBaseURI(baseURI, subscriptionID) } func NewManagedInstanceTdeCertificatesClient(subscriptionID string) ManagedInstanceTdeCertificatesClient { return original.NewManagedInstanceTdeCertificatesClient(subscriptionID) @@ -424,6 +415,9 @@ func PossibleElasticPoolStateValues() []ElasticPoolState { func PossibleInstanceFailoverGroupReplicationRoleValues() []InstanceFailoverGroupReplicationRole { return original.PossibleInstanceFailoverGroupReplicationRoleValues() } +func PossibleInterfaceEndpointProfileStateTypeValues() []InterfaceEndpointProfileStateType { + return original.PossibleInterfaceEndpointProfileStateTypeValues() +} func PossibleLogSizeUnitValues() []LogSizeUnit { return original.PossibleLogSizeUnitValues() } @@ -445,9 +439,6 @@ func PossibleReadWriteEndpointFailoverPolicyValues() []ReadWriteEndpointFailover func PossibleSampleNameValues() []SampleName { return original.PossibleSampleNameValues() } -func PossibleServerKeyTypeValues() []ServerKeyType { - return original.PossibleServerKeyTypeValues() -} func PossibleVulnerabilityAssessmentScanStateValues() []VulnerabilityAssessmentScanState { return original.PossibleVulnerabilityAssessmentScanStateValues() } diff --git a/services/preview/sql/mgmt/2017-03-01-preview/sql/sensitivitylabels.go b/services/preview/sql/mgmt/2017-03-01-preview/sql/sensitivitylabels.go index 70115a06a3b4..fe6c901aa5f1 100644 --- a/services/preview/sql/mgmt/2017-03-01-preview/sql/sensitivitylabels.go +++ b/services/preview/sql/mgmt/2017-03-01-preview/sql/sensitivitylabels.go @@ -376,108 +376,3 @@ func (client SensitivityLabelsClient) ListByDatabaseComplete(ctx context.Context result.page, err = client.ListByDatabase(ctx, resourceGroupName, serverName, databaseName, filter) return } - -// ListByDatabaseWithSource gets the sensitivity labels of a given database -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// databaseName - the name of the database. -// sensitivityLabelSource - optional source of the sensitivity label. Valid values are current or recommeneded. -// In not specified both returned. -// filter - an OData filter expression that filters elements in the collection. -func (client SensitivityLabelsClient) ListByDatabaseWithSource(ctx context.Context, resourceGroupName string, serverName string, databaseName string, sensitivityLabelSource SensitivityLabelSource, filter string) (result SensitivityLabelListResultPage, err error) { - result.fn = client.listByDatabaseWithSourceNextResults - req, err := client.ListByDatabaseWithSourcePreparer(ctx, resourceGroupName, serverName, databaseName, sensitivityLabelSource, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "ListByDatabaseWithSource", nil, "Failure preparing request") - return - } - - resp, err := client.ListByDatabaseWithSourceSender(req) - if err != nil { - result.sllr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "ListByDatabaseWithSource", resp, "Failure sending request") - return - } - - result.sllr, err = client.ListByDatabaseWithSourceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "ListByDatabaseWithSource", resp, "Failure responding to request") - } - - return -} - -// ListByDatabaseWithSourcePreparer prepares the ListByDatabaseWithSource request. -func (client SensitivityLabelsClient) ListByDatabaseWithSourcePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, sensitivityLabelSource SensitivityLabelSource, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sensitivityLabelSource": autorest.Encode("path", sensitivityLabelSource), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sensitivityLabels/{sensitivityLabelSource}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByDatabaseWithSourceSender sends the ListByDatabaseWithSource request. The method will close the -// http.Response Body if it receives an error. -func (client SensitivityLabelsClient) ListByDatabaseWithSourceSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByDatabaseWithSourceResponder handles the response to the ListByDatabaseWithSource request. The method always -// closes the http.Response Body. -func (client SensitivityLabelsClient) ListByDatabaseWithSourceResponder(resp *http.Response) (result SensitivityLabelListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByDatabaseWithSourceNextResults retrieves the next set of results, if any. -func (client SensitivityLabelsClient) listByDatabaseWithSourceNextResults(lastResults SensitivityLabelListResult) (result SensitivityLabelListResult, err error) { - req, err := lastResults.sensitivityLabelListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "listByDatabaseWithSourceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByDatabaseWithSourceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "listByDatabaseWithSourceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByDatabaseWithSourceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "listByDatabaseWithSourceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByDatabaseWithSourceComplete enumerates all values, automatically crossing page boundaries as required. -func (client SensitivityLabelsClient) ListByDatabaseWithSourceComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, sensitivityLabelSource SensitivityLabelSource, filter string) (result SensitivityLabelListResultIterator, err error) { - result.page, err = client.ListByDatabaseWithSource(ctx, resourceGroupName, serverName, databaseName, sensitivityLabelSource, filter) - return -} diff --git a/services/preview/sql/mgmt/2017-10-01-preview/sql/interfaceendpointprofiles.go b/services/preview/sql/mgmt/2017-10-01-preview/sql/interfaceendpointprofiles.go new file mode 100644 index 000000000000..727b88a82c12 --- /dev/null +++ b/services/preview/sql/mgmt/2017-10-01-preview/sql/interfaceendpointprofiles.go @@ -0,0 +1,363 @@ +package sql + +// 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" + "net/http" +) + +// InterfaceEndpointProfilesClient is the the Azure SQL Database management API provides a RESTful set of web services +// that interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, +// update, and delete databases. +type InterfaceEndpointProfilesClient struct { + BaseClient +} + +// NewInterfaceEndpointProfilesClient creates an instance of the InterfaceEndpointProfilesClient client. +func NewInterfaceEndpointProfilesClient(subscriptionID string) InterfaceEndpointProfilesClient { + return NewInterfaceEndpointProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewInterfaceEndpointProfilesClientWithBaseURI creates an instance of the InterfaceEndpointProfilesClient client. +func NewInterfaceEndpointProfilesClientWithBaseURI(baseURI string, subscriptionID string) InterfaceEndpointProfilesClient { + return InterfaceEndpointProfilesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a interface endpoint profile. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client InterfaceEndpointProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, interfaceEndpointProfileName string, parameters InterfaceEndpointProfile) (result InterfaceEndpointProfilesCreateOrUpdateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.InterfaceEndpointProfileProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.InterfaceEndpointProfileProperties.VirtualNetworkSubnetID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("sql.InterfaceEndpointProfilesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, interfaceEndpointProfileName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client InterfaceEndpointProfilesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, interfaceEndpointProfileName string, parameters InterfaceEndpointProfile) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "interfaceEndpointProfileName": autorest.Encode("path", interfaceEndpointProfileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-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.Sql/servers/{serverName}/interfaceEndpointProfiles/{interfaceEndpointProfileName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client InterfaceEndpointProfilesClient) CreateOrUpdateSender(req *http.Request) (future InterfaceEndpointProfilesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client InterfaceEndpointProfilesClient) CreateOrUpdateResponder(resp *http.Response) (result InterfaceEndpointProfile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the interface endpoint profile with the given name. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client InterfaceEndpointProfilesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, interfaceEndpointProfileName string) (result InterfaceEndpointProfilesDeleteFuture, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, interfaceEndpointProfileName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client InterfaceEndpointProfilesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, interfaceEndpointProfileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "interfaceEndpointProfileName": autorest.Encode("path", interfaceEndpointProfileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-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.Sql/servers/{serverName}/interfaceEndpointProfiles/{interfaceEndpointProfileName}", 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 InterfaceEndpointProfilesClient) DeleteSender(req *http.Request) (future InterfaceEndpointProfilesDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + 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 InterfaceEndpointProfilesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a interface endpoint profile. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// interfaceEndpointProfileName - the name of the interface endpoint profile. +func (client InterfaceEndpointProfilesClient) Get(ctx context.Context, resourceGroupName string, serverName string, interfaceEndpointProfileName string) (result InterfaceEndpointProfile, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName, interfaceEndpointProfileName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client InterfaceEndpointProfilesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, interfaceEndpointProfileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "interfaceEndpointProfileName": autorest.Encode("path", interfaceEndpointProfileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-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.Sql/servers/{serverName}/interfaceEndpointProfiles/{interfaceEndpointProfileName}", 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 InterfaceEndpointProfilesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client InterfaceEndpointProfilesClient) GetResponder(resp *http.Response) (result InterfaceEndpointProfile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByServer gets a list of interface endpoint profiles attached to a server. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client InterfaceEndpointProfilesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result InterfaceEndpointProfilesListResultPage, err error) { + result.fn = client.listByServerNextResults + req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesClient", "ListByServer", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServerSender(req) + if err != nil { + result.ieplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesClient", "ListByServer", resp, "Failure sending request") + return + } + + result.ieplr, err = client.ListByServerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesClient", "ListByServer", resp, "Failure responding to request") + } + + return +} + +// ListByServerPreparer prepares the ListByServer request. +func (client InterfaceEndpointProfilesClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-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.Sql/servers/{serverName}/interfaceEndpointProfiles", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServerSender sends the ListByServer request. The method will close the +// http.Response Body if it receives an error. +func (client InterfaceEndpointProfilesClient) ListByServerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServerResponder handles the response to the ListByServer request. The method always +// closes the http.Response Body. +func (client InterfaceEndpointProfilesClient) ListByServerResponder(resp *http.Response) (result InterfaceEndpointProfilesListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServerNextResults retrieves the next set of results, if any. +func (client InterfaceEndpointProfilesClient) listByServerNextResults(lastResults InterfaceEndpointProfilesListResult) (result InterfaceEndpointProfilesListResult, err error) { + req, err := lastResults.interfaceEndpointProfilesListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesClient", "listByServerNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesClient", "listByServerNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesClient", "listByServerNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. +func (client InterfaceEndpointProfilesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result InterfaceEndpointProfilesListResultIterator, err error) { + result.page, err = client.ListByServer(ctx, resourceGroupName, serverName) + return +} diff --git a/services/preview/sql/mgmt/2017-10-01-preview/sql/managedinstanceencryptionprotectors.go b/services/preview/sql/mgmt/2017-10-01-preview/sql/managedinstanceencryptionprotectors.go deleted file mode 100644 index 1658b1a78fa4..000000000000 --- a/services/preview/sql/mgmt/2017-10-01-preview/sql/managedinstanceencryptionprotectors.go +++ /dev/null @@ -1,285 +0,0 @@ -package sql - -// 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" - "net/http" -) - -// ManagedInstanceEncryptionProtectorsClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ManagedInstanceEncryptionProtectorsClient struct { - BaseClient -} - -// NewManagedInstanceEncryptionProtectorsClient creates an instance of the ManagedInstanceEncryptionProtectorsClient -// client. -func NewManagedInstanceEncryptionProtectorsClient(subscriptionID string) ManagedInstanceEncryptionProtectorsClient { - return NewManagedInstanceEncryptionProtectorsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedInstanceEncryptionProtectorsClientWithBaseURI creates an instance of the -// ManagedInstanceEncryptionProtectorsClient client. -func NewManagedInstanceEncryptionProtectorsClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceEncryptionProtectorsClient { - return ManagedInstanceEncryptionProtectorsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate updates an existing encryption protector. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// managedInstanceName - the name of the managed instance. -// parameters - the requested encryption protector resource state. -func (client ManagedInstanceEncryptionProtectorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstanceEncryptionProtector) (result ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture, err error) { - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedInstanceEncryptionProtectorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstanceEncryptionProtector) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "encryptionProtectorName": autorest.Encode("path", "current"), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedInstanceEncryptionProtectorsClient) CreateOrUpdateSender(req *http.Request) (future ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ManagedInstanceEncryptionProtectorsClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedInstanceEncryptionProtector, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a managed instance encryption protector. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// managedInstanceName - the name of the managed instance. -func (client ManagedInstanceEncryptionProtectorsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedInstanceEncryptionProtector, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedInstanceEncryptionProtectorsClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "encryptionProtectorName": autorest.Encode("path", "current"), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedInstanceEncryptionProtectorsClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ManagedInstanceEncryptionProtectorsClient) GetResponder(resp *http.Response) (result ManagedInstanceEncryptionProtector, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByInstance gets a list of managed instance encryption protectors -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// managedInstanceName - the name of the managed instance. -func (client ManagedInstanceEncryptionProtectorsClient) ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedInstanceEncryptionProtectorListResultPage, err error) { - result.fn = client.listByInstanceNextResults - req, err := client.ListByInstancePreparer(ctx, resourceGroupName, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "ListByInstance", nil, "Failure preparing request") - return - } - - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.mieplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "ListByInstance", resp, "Failure sending request") - return - } - - result.mieplr, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "ListByInstance", resp, "Failure responding to request") - } - - return -} - -// ListByInstancePreparer prepares the ListByInstance request. -func (client ManagedInstanceEncryptionProtectorsClient) ListByInstancePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/encryptionProtector", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByInstanceSender sends the ListByInstance request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedInstanceEncryptionProtectorsClient) ListByInstanceSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByInstanceResponder handles the response to the ListByInstance request. The method always -// closes the http.Response Body. -func (client ManagedInstanceEncryptionProtectorsClient) ListByInstanceResponder(resp *http.Response) (result ManagedInstanceEncryptionProtectorListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByInstanceNextResults retrieves the next set of results, if any. -func (client ManagedInstanceEncryptionProtectorsClient) listByInstanceNextResults(lastResults ManagedInstanceEncryptionProtectorListResult) (result ManagedInstanceEncryptionProtectorListResult, err error) { - req, err := lastResults.managedInstanceEncryptionProtectorListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "listByInstanceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "listByInstanceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "listByInstanceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByInstanceComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedInstanceEncryptionProtectorsClient) ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedInstanceEncryptionProtectorListResultIterator, err error) { - result.page, err = client.ListByInstance(ctx, resourceGroupName, managedInstanceName) - return -} diff --git a/services/preview/sql/mgmt/2017-10-01-preview/sql/managedinstancekeys.go b/services/preview/sql/mgmt/2017-10-01-preview/sql/managedinstancekeys.go deleted file mode 100644 index 536e082ceebf..000000000000 --- a/services/preview/sql/mgmt/2017-10-01-preview/sql/managedinstancekeys.go +++ /dev/null @@ -1,362 +0,0 @@ -package sql - -// 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" - "net/http" -) - -// ManagedInstanceKeysClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type ManagedInstanceKeysClient struct { - BaseClient -} - -// NewManagedInstanceKeysClient creates an instance of the ManagedInstanceKeysClient client. -func NewManagedInstanceKeysClient(subscriptionID string) ManagedInstanceKeysClient { - return NewManagedInstanceKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedInstanceKeysClientWithBaseURI creates an instance of the ManagedInstanceKeysClient client. -func NewManagedInstanceKeysClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceKeysClient { - return ManagedInstanceKeysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a managed instance key. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// managedInstanceName - the name of the managed instance. -// keyName - the name of the managed instance key to be operated on (updated or created). -// parameters - the requested managed instance key resource state. -func (client ManagedInstanceKeysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, parameters ManagedInstanceKey) (result ManagedInstanceKeysCreateOrUpdateFuture, err error) { - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, keyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedInstanceKeysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, parameters ManagedInstanceKey) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "keyName": autorest.Encode("path", keyName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/keys/{keyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedInstanceKeysClient) CreateOrUpdateSender(req *http.Request) (future ManagedInstanceKeysCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ManagedInstanceKeysClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedInstanceKey, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the managed instance key with the given name. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// managedInstanceName - the name of the managed instance. -// keyName - the name of the managed instance key to be deleted. -func (client ManagedInstanceKeysClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string) (result ManagedInstanceKeysDeleteFuture, err error) { - req, err := client.DeletePreparer(ctx, resourceGroupName, managedInstanceName, keyName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ManagedInstanceKeysClient) DeletePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "keyName": autorest.Encode("path", keyName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/keys/{keyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedInstanceKeysClient) DeleteSender(req *http.Request) (future ManagedInstanceKeysDeleteFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - 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 ManagedInstanceKeysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a managed instance key. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// managedInstanceName - the name of the managed instance. -// keyName - the name of the managed instance key to be retrieved. -func (client ManagedInstanceKeysClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string) (result ManagedInstanceKey, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, managedInstanceName, keyName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedInstanceKeysClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "keyName": autorest.Encode("path", keyName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/keys/{keyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedInstanceKeysClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ManagedInstanceKeysClient) GetResponder(resp *http.Response) (result ManagedInstanceKey, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByInstance gets a list of managed instance keys. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// managedInstanceName - the name of the managed instance. -// filter - an OData filter expression that filters elements in the collection. -func (client ManagedInstanceKeysClient) ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string, filter string) (result ManagedInstanceKeyListResultPage, err error) { - result.fn = client.listByInstanceNextResults - req, err := client.ListByInstancePreparer(ctx, resourceGroupName, managedInstanceName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "ListByInstance", nil, "Failure preparing request") - return - } - - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.miklr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "ListByInstance", resp, "Failure sending request") - return - } - - result.miklr, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "ListByInstance", resp, "Failure responding to request") - } - - return -} - -// ListByInstancePreparer prepares the ListByInstance request. -func (client ManagedInstanceKeysClient) ListByInstancePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByInstanceSender sends the ListByInstance request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedInstanceKeysClient) ListByInstanceSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByInstanceResponder handles the response to the ListByInstance request. The method always -// closes the http.Response Body. -func (client ManagedInstanceKeysClient) ListByInstanceResponder(resp *http.Response) (result ManagedInstanceKeyListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByInstanceNextResults retrieves the next set of results, if any. -func (client ManagedInstanceKeysClient) listByInstanceNextResults(lastResults ManagedInstanceKeyListResult) (result ManagedInstanceKeyListResult, err error) { - req, err := lastResults.managedInstanceKeyListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "listByInstanceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "listByInstanceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "listByInstanceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByInstanceComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedInstanceKeysClient) ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, filter string) (result ManagedInstanceKeyListResultIterator, err error) { - result.page, err = client.ListByInstance(ctx, resourceGroupName, managedInstanceName, filter) - return -} diff --git a/services/preview/sql/mgmt/2017-10-01-preview/sql/models.go b/services/preview/sql/mgmt/2017-10-01-preview/sql/models.go index b9d700d8359a..260627869208 100644 --- a/services/preview/sql/mgmt/2017-10-01-preview/sql/models.go +++ b/services/preview/sql/mgmt/2017-10-01-preview/sql/models.go @@ -233,6 +233,29 @@ func PossibleInstanceFailoverGroupReplicationRoleValues() []InstanceFailoverGrou return []InstanceFailoverGroupReplicationRole{Primary, Secondary} } +// InterfaceEndpointProfileStateType enumerates the values for interface endpoint profile state type. +type InterfaceEndpointProfileStateType string + +const ( + // Deleting ... + Deleting InterfaceEndpointProfileStateType = "Deleting" + // Failed ... + Failed InterfaceEndpointProfileStateType = "Failed" + // Initializing ... + Initializing InterfaceEndpointProfileStateType = "Initializing" + // InProgress ... + InProgress InterfaceEndpointProfileStateType = "InProgress" + // Ready ... + Ready InterfaceEndpointProfileStateType = "Ready" + // Unknown ... + Unknown InterfaceEndpointProfileStateType = "Unknown" +) + +// PossibleInterfaceEndpointProfileStateTypeValues returns an array of possible values for the InterfaceEndpointProfileStateType const type. +func PossibleInterfaceEndpointProfileStateTypeValues() []InterfaceEndpointProfileStateType { + return []InterfaceEndpointProfileStateType{Deleting, Failed, Initializing, InProgress, Ready, Unknown} +} + // LogSizeUnit enumerates the values for log size unit. type LogSizeUnit string @@ -258,23 +281,23 @@ func PossibleLogSizeUnitValues() []LogSizeUnit { type ManagementOperationState string const ( - // CancelInProgress ... - CancelInProgress ManagementOperationState = "CancelInProgress" - // Cancelled ... - Cancelled ManagementOperationState = "Cancelled" - // Failed ... - Failed ManagementOperationState = "Failed" - // InProgress ... - InProgress ManagementOperationState = "InProgress" - // Pending ... - Pending ManagementOperationState = "Pending" - // Succeeded ... - Succeeded ManagementOperationState = "Succeeded" + // ManagementOperationStateCancelInProgress ... + ManagementOperationStateCancelInProgress ManagementOperationState = "CancelInProgress" + // ManagementOperationStateCancelled ... + ManagementOperationStateCancelled ManagementOperationState = "Cancelled" + // ManagementOperationStateFailed ... + ManagementOperationStateFailed ManagementOperationState = "Failed" + // ManagementOperationStateInProgress ... + ManagementOperationStateInProgress ManagementOperationState = "InProgress" + // ManagementOperationStatePending ... + ManagementOperationStatePending ManagementOperationState = "Pending" + // ManagementOperationStateSucceeded ... + ManagementOperationStateSucceeded ManagementOperationState = "Succeeded" ) // PossibleManagementOperationStateValues returns an array of possible values for the ManagementOperationState const type. func PossibleManagementOperationStateValues() []ManagementOperationState { - return []ManagementOperationState{CancelInProgress, Cancelled, Failed, InProgress, Pending, Succeeded} + return []ManagementOperationState{ManagementOperationStateCancelInProgress, ManagementOperationStateCancelled, ManagementOperationStateFailed, ManagementOperationStateInProgress, ManagementOperationStatePending, ManagementOperationStateSucceeded} } // MaxSizeUnit enumerates the values for max size unit. @@ -358,21 +381,6 @@ func PossibleSampleNameValues() []SampleName { return []SampleName{AdventureWorksLT, WideWorldImportersFull, WideWorldImportersStd} } -// ServerKeyType enumerates the values for server key type. -type ServerKeyType string - -const ( - // AzureKeyVault ... - AzureKeyVault ServerKeyType = "AzureKeyVault" - // ServiceManaged ... - ServiceManaged ServerKeyType = "ServiceManaged" -) - -// PossibleServerKeyTypeValues returns an array of possible values for the ServerKeyType const type. -func PossibleServerKeyTypeValues() []ServerKeyType { - return []ServerKeyType{AzureKeyVault, ServiceManaged} -} - // VulnerabilityAssessmentScanState enumerates the values for vulnerability assessment scan state. type VulnerabilityAssessmentScanState string @@ -1107,7 +1115,7 @@ type DatabaseOperationProperties struct { ServerName *string `json:"serverName,omitempty"` // StartTime - The operation start time. StartTime *date.Time `json:"startTime,omitempty"` - // State - The operation state. Possible values include: 'Pending', 'InProgress', 'Succeeded', 'Failed', 'CancelInProgress', 'Cancelled' + // State - The operation state. Possible values include: 'ManagementOperationStatePending', 'ManagementOperationStateInProgress', 'ManagementOperationStateSucceeded', 'ManagementOperationStateFailed', 'ManagementOperationStateCancelInProgress', 'ManagementOperationStateCancelled' State ManagementOperationState `json:"state,omitempty"` // ErrorCode - The operation error code. ErrorCode *int32 `json:"errorCode,omitempty"` @@ -2570,58 +2578,11 @@ func (future *InstanceFailoverGroupsForceFailoverAllowDataLossFuture) Result(cli return } -// LicenseTypeCapability the license type capability -type LicenseTypeCapability struct { - // Name - License type identifier. - Name *string `json:"name,omitempty"` - // Status - The status of the capability. Possible values include: 'Visible', 'Available', 'Default', 'Disabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// LocationCapabilities the location capability. -type LocationCapabilities struct { - autorest.Response `json:"-"` - // Name - The location name. - Name *string `json:"name,omitempty"` - // SupportedServerVersions - The list of supported server versions. - SupportedServerVersions *[]ServerVersionCapability `json:"supportedServerVersions,omitempty"` - // SupportedManagedInstanceVersions - The list of supported managed instance versions. - SupportedManagedInstanceVersions *[]ManagedInstanceVersionCapability `json:"supportedManagedInstanceVersions,omitempty"` - // Status - The status of the capability. Possible values include: 'Visible', 'Available', 'Default', 'Disabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// LogSizeCapability the log size capability. -type LogSizeCapability struct { - // Limit - The log size limit (see 'unit' for the units). - Limit *int32 `json:"limit,omitempty"` - // Unit - The units that the limit is expressed in. Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes', 'Percent' - Unit LogSizeUnit `json:"unit,omitempty"` -} - -// ManagedInstanceEditionCapability the managed server capability -type ManagedInstanceEditionCapability struct { - // Name - The managed server version name. - Name *string `json:"name,omitempty"` - // SupportedFamilies - The supported families. - SupportedFamilies *[]ManagedInstanceFamilyCapability `json:"supportedFamilies,omitempty"` - // Status - The status of the capability. Possible values include: 'Visible', 'Available', 'Default', 'Disabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// ManagedInstanceEncryptionProtector the managed instance encryption protector. -type ManagedInstanceEncryptionProtector struct { +// InterfaceEndpointProfile a interface endpoint profile resource. +type InterfaceEndpointProfile struct { autorest.Response `json:"-"` - // Kind - Kind of encryption protector. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // ManagedInstanceEncryptionProtectorProperties - Resource properties. - *ManagedInstanceEncryptionProtectorProperties `json:"properties,omitempty"` + // InterfaceEndpointProfileProperties - Resource properties. + *InterfaceEndpointProfileProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -2630,29 +2591,26 @@ type ManagedInstanceEncryptionProtector struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ManagedInstanceEncryptionProtector. -func (miep ManagedInstanceEncryptionProtector) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for InterfaceEndpointProfile. +func (iep InterfaceEndpointProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if miep.Kind != nil { - objectMap["kind"] = miep.Kind + if iep.InterfaceEndpointProfileProperties != nil { + objectMap["properties"] = iep.InterfaceEndpointProfileProperties } - if miep.ManagedInstanceEncryptionProtectorProperties != nil { - objectMap["properties"] = miep.ManagedInstanceEncryptionProtectorProperties + if iep.ID != nil { + objectMap["id"] = iep.ID } - if miep.ID != nil { - objectMap["id"] = miep.ID + if iep.Name != nil { + objectMap["name"] = iep.Name } - if miep.Name != nil { - objectMap["name"] = miep.Name - } - if miep.Type != nil { - objectMap["type"] = miep.Type + if iep.Type != nil { + objectMap["type"] = iep.Type } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ManagedInstanceEncryptionProtector struct. -func (miep *ManagedInstanceEncryptionProtector) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for InterfaceEndpointProfile struct. +func (iep *InterfaceEndpointProfile) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -2660,23 +2618,14 @@ func (miep *ManagedInstanceEncryptionProtector) UnmarshalJSON(body []byte) error } for k, v := range m { switch k { - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - miep.Kind = &kind - } case "properties": if v != nil { - var managedInstanceEncryptionProtectorProperties ManagedInstanceEncryptionProtectorProperties - err = json.Unmarshal(*v, &managedInstanceEncryptionProtectorProperties) + var interfaceEndpointProfileProperties InterfaceEndpointProfileProperties + err = json.Unmarshal(*v, &interfaceEndpointProfileProperties) if err != nil { return err } - miep.ManagedInstanceEncryptionProtectorProperties = &managedInstanceEncryptionProtectorProperties + iep.InterfaceEndpointProfileProperties = &interfaceEndpointProfileProperties } case "id": if v != nil { @@ -2685,7 +2634,7 @@ func (miep *ManagedInstanceEncryptionProtector) UnmarshalJSON(body []byte) error if err != nil { return err } - miep.ID = &ID + iep.ID = &ID } case "name": if v != nil { @@ -2694,7 +2643,7 @@ func (miep *ManagedInstanceEncryptionProtector) UnmarshalJSON(body []byte) error if err != nil { return err } - miep.Name = &name + iep.Name = &name } case "type": if v != nil { @@ -2703,7 +2652,7 @@ func (miep *ManagedInstanceEncryptionProtector) UnmarshalJSON(body []byte) error if err != nil { return err } - miep.Type = &typeVar + iep.Type = &typeVar } } } @@ -2711,284 +2660,87 @@ func (miep *ManagedInstanceEncryptionProtector) UnmarshalJSON(body []byte) error return nil } -// ManagedInstanceEncryptionProtectorListResult a list of managed instance encryption protectors. -type ManagedInstanceEncryptionProtectorListResult struct { - autorest.Response `json:"-"` - // Value - Array of results. - Value *[]ManagedInstanceEncryptionProtector `json:"value,omitempty"` - // NextLink - Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ManagedInstanceEncryptionProtectorListResultIterator provides access to a complete listing of -// ManagedInstanceEncryptionProtector values. -type ManagedInstanceEncryptionProtectorListResultIterator struct { - i int - page ManagedInstanceEncryptionProtectorListResultPage +// InterfaceEndpointProfileProperties the properties of a interface endpoint profile. +type InterfaceEndpointProfileProperties struct { + // VirtualNetworkSubnetID - The ARM resource id of the virtual network subnet. + VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` + // PrivateIP - The Private ip associated with the interface endpoint profile + PrivateIP *string `json:"privateIp,omitempty"` + // State - State of the interface endpoint profile. Possible values include: 'Initializing', 'InProgress', 'Ready', 'Failed', 'Deleting', 'Unknown' + State InterfaceEndpointProfileStateType `json:"state,omitempty"` } -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ManagedInstanceEncryptionProtectorListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ManagedInstanceEncryptionProtectorListResultIterator) 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 ManagedInstanceEncryptionProtectorListResultIterator) Response() ManagedInstanceEncryptionProtectorListResult { - 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 ManagedInstanceEncryptionProtectorListResultIterator) Value() ManagedInstanceEncryptionProtector { - if !iter.page.NotDone() { - return ManagedInstanceEncryptionProtector{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (mieplr ManagedInstanceEncryptionProtectorListResult) IsEmpty() bool { - return mieplr.Value == nil || len(*mieplr.Value) == 0 -} - -// managedInstanceEncryptionProtectorListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (mieplr ManagedInstanceEncryptionProtectorListResult) managedInstanceEncryptionProtectorListResultPreparer() (*http.Request, error) { - if mieplr.NextLink == nil || len(to.String(mieplr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(mieplr.NextLink))) -} - -// ManagedInstanceEncryptionProtectorListResultPage contains a page of ManagedInstanceEncryptionProtector values. -type ManagedInstanceEncryptionProtectorListResultPage struct { - fn func(ManagedInstanceEncryptionProtectorListResult) (ManagedInstanceEncryptionProtectorListResult, error) - mieplr ManagedInstanceEncryptionProtectorListResult -} - -// 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. -func (page *ManagedInstanceEncryptionProtectorListResultPage) Next() error { - next, err := page.fn(page.mieplr) - if err != nil { - return err - } - page.mieplr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ManagedInstanceEncryptionProtectorListResultPage) NotDone() bool { - return !page.mieplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ManagedInstanceEncryptionProtectorListResultPage) Response() ManagedInstanceEncryptionProtectorListResult { - return page.mieplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ManagedInstanceEncryptionProtectorListResultPage) Values() []ManagedInstanceEncryptionProtector { - if page.mieplr.IsEmpty() { - return nil - } - return *page.mieplr.Value -} - -// ManagedInstanceEncryptionProtectorProperties properties for an encryption protector execution. -type ManagedInstanceEncryptionProtectorProperties struct { - // ServerKeyName - The name of the managed instance key. - ServerKeyName *string `json:"serverKeyName,omitempty"` - // ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault' - ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"` - // URI - The URI of the server key. - URI *string `json:"uri,omitempty"` - // Thumbprint - Thumbprint of the server key. - Thumbprint *string `json:"thumbprint,omitempty"` -} - -// ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture struct { +// InterfaceEndpointProfilesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type InterfaceEndpointProfilesCreateOrUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture) Result(client ManagedInstanceEncryptionProtectorsClient) (miep ManagedInstanceEncryptionProtector, err error) { +func (future *InterfaceEndpointProfilesCreateOrUpdateFuture) Result(client InterfaceEndpointProfilesClient) (iep InterfaceEndpointProfile, err error) { var done bool done, err = future.Done(client) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture") + err = azure.NewAsyncOpIncompleteError("sql.InterfaceEndpointProfilesCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if miep.Response.Response, err = future.GetResult(sender); err == nil && miep.Response.Response.StatusCode != http.StatusNoContent { - miep, err = client.CreateOrUpdateResponder(miep.Response.Response) + if iep.Response.Response, err = future.GetResult(sender); err == nil && iep.Response.Response.StatusCode != http.StatusNoContent { + iep, err = client.CreateOrUpdateResponder(iep.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture", "Result", miep.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesCreateOrUpdateFuture", "Result", iep.Response.Response, "Failure responding to request") } } return } -// ManagedInstanceFamilyCapability the managed server family capability. -type ManagedInstanceFamilyCapability struct { - // Name - Family name. - Name *string `json:"name,omitempty"` - // Sku - SKU name. - Sku *string `json:"sku,omitempty"` - // SupportedLicenseTypes - List of supported license types. - SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"` - // SupportedVcoresValues - List of supported virtual cores values. - SupportedVcoresValues *[]ManagedInstanceVcoresCapability `json:"supportedVcoresValues,omitempty"` - // IncludedMaxSize - Included size. - IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"` - // SupportedStorageSizes - Storage size ranges. - SupportedStorageSizes *[]MaxSizeRangeCapability `json:"supportedStorageSizes,omitempty"` - // Status - The status of the capability. Possible values include: 'Visible', 'Available', 'Default', 'Disabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// ManagedInstanceKey a managed instance key. -type ManagedInstanceKey struct { - autorest.Response `json:"-"` - // Kind - Kind of encryption protector. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // ManagedInstanceKeyProperties - Resource properties. - *ManagedInstanceKeyProperties `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ManagedInstanceKey. -func (mik ManagedInstanceKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mik.Kind != nil { - objectMap["kind"] = mik.Kind - } - if mik.ManagedInstanceKeyProperties != nil { - objectMap["properties"] = mik.ManagedInstanceKeyProperties - } - if mik.ID != nil { - objectMap["id"] = mik.ID - } - if mik.Name != nil { - objectMap["name"] = mik.Name - } - if mik.Type != nil { - objectMap["type"] = mik.Type - } - return json.Marshal(objectMap) +// InterfaceEndpointProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type InterfaceEndpointProfilesDeleteFuture struct { + azure.Future } -// UnmarshalJSON is the custom unmarshaler for ManagedInstanceKey struct. -func (mik *ManagedInstanceKey) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *InterfaceEndpointProfilesDeleteFuture) Result(client InterfaceEndpointProfilesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) if err != nil { - return err + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesDeleteFuture", "Result", future.Response(), "Polling failure") + return } - for k, v := range m { - switch k { - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - mik.Kind = &kind - } - case "properties": - if v != nil { - var managedInstanceKeyProperties ManagedInstanceKeyProperties - err = json.Unmarshal(*v, &managedInstanceKeyProperties) - if err != nil { - return err - } - mik.ManagedInstanceKeyProperties = &managedInstanceKeyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mik.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mik.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mik.Type = &typeVar - } - } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.InterfaceEndpointProfilesDeleteFuture") + return } - - return nil + ar.Response = future.Response() + return } -// ManagedInstanceKeyListResult a list of managed instance keys. -type ManagedInstanceKeyListResult struct { +// InterfaceEndpointProfilesListResult a list of interface endpoint profiles. +type InterfaceEndpointProfilesListResult struct { autorest.Response `json:"-"` // Value - Array of results. - Value *[]ManagedInstanceKey `json:"value,omitempty"` + Value *[]InterfaceEndpointProfile `json:"value,omitempty"` // NextLink - Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } -// ManagedInstanceKeyListResultIterator provides access to a complete listing of ManagedInstanceKey values. -type ManagedInstanceKeyListResultIterator struct { +// InterfaceEndpointProfilesListResultIterator provides access to a complete listing of InterfaceEndpointProfile +// values. +type InterfaceEndpointProfilesListResultIterator struct { i int - page ManagedInstanceKeyListResultPage + page InterfaceEndpointProfilesListResultPage } // Next 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 *ManagedInstanceKeyListResultIterator) Next() error { +func (iter *InterfaceEndpointProfilesListResultIterator) Next() error { iter.i++ if iter.i < len(iter.page.Values()) { return nil @@ -3003,138 +2755,139 @@ func (iter *ManagedInstanceKeyListResultIterator) Next() error { } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ManagedInstanceKeyListResultIterator) NotDone() bool { +func (iter InterfaceEndpointProfilesListResultIterator) 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 ManagedInstanceKeyListResultIterator) Response() ManagedInstanceKeyListResult { +func (iter InterfaceEndpointProfilesListResultIterator) Response() InterfaceEndpointProfilesListResult { 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 ManagedInstanceKeyListResultIterator) Value() ManagedInstanceKey { +func (iter InterfaceEndpointProfilesListResultIterator) Value() InterfaceEndpointProfile { if !iter.page.NotDone() { - return ManagedInstanceKey{} + return InterfaceEndpointProfile{} } return iter.page.Values()[iter.i] } // IsEmpty returns true if the ListResult contains no values. -func (miklr ManagedInstanceKeyListResult) IsEmpty() bool { - return miklr.Value == nil || len(*miklr.Value) == 0 +func (ieplr InterfaceEndpointProfilesListResult) IsEmpty() bool { + return ieplr.Value == nil || len(*ieplr.Value) == 0 } -// managedInstanceKeyListResultPreparer prepares a request to retrieve the next set of results. +// interfaceEndpointProfilesListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (miklr ManagedInstanceKeyListResult) managedInstanceKeyListResultPreparer() (*http.Request, error) { - if miklr.NextLink == nil || len(to.String(miklr.NextLink)) < 1 { +func (ieplr InterfaceEndpointProfilesListResult) interfaceEndpointProfilesListResultPreparer() (*http.Request, error) { + if ieplr.NextLink == nil || len(to.String(ieplr.NextLink)) < 1 { return nil, nil } return autorest.Prepare(&http.Request{}, autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(miklr.NextLink))) + autorest.WithBaseURL(to.String(ieplr.NextLink))) } -// ManagedInstanceKeyListResultPage contains a page of ManagedInstanceKey values. -type ManagedInstanceKeyListResultPage struct { - fn func(ManagedInstanceKeyListResult) (ManagedInstanceKeyListResult, error) - miklr ManagedInstanceKeyListResult +// InterfaceEndpointProfilesListResultPage contains a page of InterfaceEndpointProfile values. +type InterfaceEndpointProfilesListResultPage struct { + fn func(InterfaceEndpointProfilesListResult) (InterfaceEndpointProfilesListResult, error) + ieplr InterfaceEndpointProfilesListResult } // 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. -func (page *ManagedInstanceKeyListResultPage) Next() error { - next, err := page.fn(page.miklr) +func (page *InterfaceEndpointProfilesListResultPage) Next() error { + next, err := page.fn(page.ieplr) if err != nil { return err } - page.miklr = next + page.ieplr = next return nil } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ManagedInstanceKeyListResultPage) NotDone() bool { - return !page.miklr.IsEmpty() +func (page InterfaceEndpointProfilesListResultPage) NotDone() bool { + return !page.ieplr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ManagedInstanceKeyListResultPage) Response() ManagedInstanceKeyListResult { - return page.miklr +func (page InterfaceEndpointProfilesListResultPage) Response() InterfaceEndpointProfilesListResult { + return page.ieplr } // Values returns the slice of values for the current page or nil if there are no values. -func (page ManagedInstanceKeyListResultPage) Values() []ManagedInstanceKey { - if page.miklr.IsEmpty() { +func (page InterfaceEndpointProfilesListResultPage) Values() []InterfaceEndpointProfile { + if page.ieplr.IsEmpty() { return nil } - return *page.miklr.Value + return *page.ieplr.Value } -// ManagedInstanceKeyProperties properties for a key execution. -type ManagedInstanceKeyProperties struct { - // ServerKeyType - The key type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault' - ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"` - // URI - The URI of the key. If the ServerKeyType is AzureKeyVault, then the URI is required. - URI *string `json:"uri,omitempty"` - // Thumbprint - Thumbprint of the key. - Thumbprint *string `json:"thumbprint,omitempty"` - // CreationDate - The key creation date. - CreationDate *date.Time `json:"creationDate,omitempty"` +// LicenseTypeCapability the license type capability +type LicenseTypeCapability struct { + // Name - License type identifier. + Name *string `json:"name,omitempty"` + // Status - The status of the capability. Possible values include: 'Visible', 'Available', 'Default', 'Disabled' + Status CapabilityStatus `json:"status,omitempty"` + // Reason - The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` } -// ManagedInstanceKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ManagedInstanceKeysCreateOrUpdateFuture struct { - azure.Future +// LocationCapabilities the location capability. +type LocationCapabilities struct { + autorest.Response `json:"-"` + // Name - The location name. + Name *string `json:"name,omitempty"` + // SupportedServerVersions - The list of supported server versions. + SupportedServerVersions *[]ServerVersionCapability `json:"supportedServerVersions,omitempty"` + // SupportedManagedInstanceVersions - The list of supported managed instance versions. + SupportedManagedInstanceVersions *[]ManagedInstanceVersionCapability `json:"supportedManagedInstanceVersions,omitempty"` + // Status - The status of the capability. Possible values include: 'Visible', 'Available', 'Default', 'Disabled' + Status CapabilityStatus `json:"status,omitempty"` + // Reason - The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedInstanceKeysCreateOrUpdateFuture) Result(client ManagedInstanceKeysClient) (mik ManagedInstanceKey, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceKeysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if mik.Response.Response, err = future.GetResult(sender); err == nil && mik.Response.Response.StatusCode != http.StatusNoContent { - mik, err = client.CreateOrUpdateResponder(mik.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysCreateOrUpdateFuture", "Result", mik.Response.Response, "Failure responding to request") - } - } - return +// LogSizeCapability the log size capability. +type LogSizeCapability struct { + // Limit - The log size limit (see 'unit' for the units). + Limit *int32 `json:"limit,omitempty"` + // Unit - The units that the limit is expressed in. Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes', 'Percent' + Unit LogSizeUnit `json:"unit,omitempty"` } -// ManagedInstanceKeysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ManagedInstanceKeysDeleteFuture struct { - azure.Future +// ManagedInstanceEditionCapability the managed server capability +type ManagedInstanceEditionCapability struct { + // Name - The managed server version name. + Name *string `json:"name,omitempty"` + // SupportedFamilies - The supported families. + SupportedFamilies *[]ManagedInstanceFamilyCapability `json:"supportedFamilies,omitempty"` + // Status - The status of the capability. Possible values include: 'Visible', 'Available', 'Default', 'Disabled' + Status CapabilityStatus `json:"status,omitempty"` + // Reason - The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedInstanceKeysDeleteFuture) Result(client ManagedInstanceKeysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceKeysDeleteFuture") - return - } - ar.Response = future.Response() - return +// ManagedInstanceFamilyCapability the managed server family capability. +type ManagedInstanceFamilyCapability struct { + // Name - Family name. + Name *string `json:"name,omitempty"` + // Sku - SKU name. + Sku *string `json:"sku,omitempty"` + // SupportedLicenseTypes - List of supported license types. + SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"` + // SupportedVcoresValues - List of supported virtual cores values. + SupportedVcoresValues *[]ManagedInstanceVcoresCapability `json:"supportedVcoresValues,omitempty"` + // IncludedMaxSize - Included size. + IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"` + // SupportedStorageSizes - Storage size ranges. + SupportedStorageSizes *[]MaxSizeRangeCapability `json:"supportedStorageSizes,omitempty"` + // Status - The status of the capability. Possible values include: 'Visible', 'Available', 'Default', 'Disabled' + Status CapabilityStatus `json:"status,omitempty"` + // Reason - The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` } // ManagedInstancePairInfo pairs of Managed Instances in the failover group.