From d5ecf1cd63f1cce02fbcc775f9f8703b87a857f6 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 4 Oct 2018 06:19:20 +0000 Subject: [PATCH] Generated from f5074a07cda67de2413f9cbe92cb6c530adb9342 Merge branch 'master' into private_preview5 --- .../preview/preview/sql/mgmt/sql/models.go | 40 +- .../sql/interfaceendpointprofiles.go | 363 ++++++++++++++++++ .../sql/mgmt/2017-10-01-preview/sql/models.go | 298 +++++++++++++- 3 files changed, 681 insertions(+), 20 deletions(-) create mode 100644 services/preview/sql/mgmt/2017-10-01-preview/sql/interfaceendpointprofiles.go diff --git a/profiles/preview/preview/sql/mgmt/sql/models.go b/profiles/preview/preview/sql/mgmt/sql/models.go index 6cf9cb68b154..883d52532db5 100644 --- a/profiles/preview/preview/sql/mgmt/sql/models.go +++ b/profiles/preview/preview/sql/mgmt/sql/models.go @@ -35,6 +35,7 @@ type DatabaseVulnerabilityAssessmentScansClient = original.DatabaseVulnerability type ElasticPoolOperationsClient = original.ElasticPoolOperationsClient type ElasticPoolsClient = original.ElasticPoolsClient type InstanceFailoverGroupsClient = original.InstanceFailoverGroupsClient +type InterfaceEndpointProfilesClient = original.InterfaceEndpointProfilesClient type ManagedInstanceEncryptionProtectorsClient = original.ManagedInstanceEncryptionProtectorsClient type ManagedInstanceKeysClient = original.ManagedInstanceKeysClient type ManagedInstanceTdeCertificatesClient = original.ManagedInstanceTdeCertificatesClient @@ -136,6 +137,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 +161,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 @@ -277,6 +289,13 @@ 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 @@ -376,6 +395,12 @@ func NewInstanceFailoverGroupsClient(subscriptionID string) InstanceFailoverGrou func NewInstanceFailoverGroupsClientWithBaseURI(baseURI string, subscriptionID string) InstanceFailoverGroupsClient { return original.NewInstanceFailoverGroupsClientWithBaseURI(baseURI, subscriptionID) } +func NewInterfaceEndpointProfilesClient(subscriptionID string) InterfaceEndpointProfilesClient { + return original.NewInterfaceEndpointProfilesClient(subscriptionID) +} +func NewInterfaceEndpointProfilesClientWithBaseURI(baseURI string, subscriptionID string) InterfaceEndpointProfilesClient { + return original.NewInterfaceEndpointProfilesClientWithBaseURI(baseURI, subscriptionID) +} func NewManagedInstanceEncryptionProtectorsClient(subscriptionID string) ManagedInstanceEncryptionProtectorsClient { return original.NewManagedInstanceEncryptionProtectorsClient(subscriptionID) } @@ -424,6 +449,9 @@ func PossibleElasticPoolStateValues() []ElasticPoolState { func PossibleInstanceFailoverGroupReplicationRoleValues() []InstanceFailoverGroupReplicationRole { return original.PossibleInstanceFailoverGroupReplicationRoleValues() } +func PossibleInterfaceEndpointProfileStateTypeValues() []InterfaceEndpointProfileStateType { + return original.PossibleInterfaceEndpointProfileStateTypeValues() +} func PossibleLogSizeUnitValues() []LogSizeUnit { return original.PossibleLogSizeUnitValues() } 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/models.go b/services/preview/sql/mgmt/2017-10-01-preview/sql/models.go index b9d700d8359a..85c617c99ebf 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. @@ -1107,7 +1130,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,6 +2593,253 @@ func (future *InstanceFailoverGroupsForceFailoverAllowDataLossFuture) Result(cli return } +// InterfaceEndpointProfile a interface endpoint profile resource. +type InterfaceEndpointProfile struct { + autorest.Response `json:"-"` + // InterfaceEndpointProfileProperties - Resource properties. + *InterfaceEndpointProfileProperties `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 InterfaceEndpointProfile. +func (iep InterfaceEndpointProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iep.InterfaceEndpointProfileProperties != nil { + objectMap["properties"] = iep.InterfaceEndpointProfileProperties + } + if iep.ID != nil { + objectMap["id"] = iep.ID + } + if iep.Name != nil { + objectMap["name"] = iep.Name + } + if iep.Type != nil { + objectMap["type"] = iep.Type + } + return json.Marshal(objectMap) +} + +// 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 { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var interfaceEndpointProfileProperties InterfaceEndpointProfileProperties + err = json.Unmarshal(*v, &interfaceEndpointProfileProperties) + if err != nil { + return err + } + iep.InterfaceEndpointProfileProperties = &interfaceEndpointProfileProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + iep.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + iep.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + iep.Type = &typeVar + } + } + } + + return nil +} + +// 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"` +} + +// 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 *InterfaceEndpointProfilesCreateOrUpdateFuture) Result(client InterfaceEndpointProfilesClient) (iep InterfaceEndpointProfile, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.InterfaceEndpointProfilesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + 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.InterfaceEndpointProfilesCreateOrUpdateFuture", "Result", iep.Response.Response, "Failure responding to request") + } + } + return +} + +// InterfaceEndpointProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type InterfaceEndpointProfilesDeleteFuture struct { + azure.Future +} + +// 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 { + err = autorest.NewErrorWithError(err, "sql.InterfaceEndpointProfilesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.InterfaceEndpointProfilesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// InterfaceEndpointProfilesListResult a list of interface endpoint profiles. +type InterfaceEndpointProfilesListResult struct { + autorest.Response `json:"-"` + // Value - Array of results. + Value *[]InterfaceEndpointProfile `json:"value,omitempty"` + // NextLink - Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// InterfaceEndpointProfilesListResultIterator provides access to a complete listing of InterfaceEndpointProfile +// values. +type InterfaceEndpointProfilesListResultIterator struct { + i int + 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 *InterfaceEndpointProfilesListResultIterator) 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 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 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 InterfaceEndpointProfilesListResultIterator) Value() InterfaceEndpointProfile { + if !iter.page.NotDone() { + return InterfaceEndpointProfile{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (ieplr InterfaceEndpointProfilesListResult) IsEmpty() bool { + return ieplr.Value == nil || len(*ieplr.Value) == 0 +} + +// interfaceEndpointProfilesListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +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(ieplr.NextLink))) +} + +// 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 *InterfaceEndpointProfilesListResultPage) Next() error { + next, err := page.fn(page.ieplr) + if err != nil { + return err + } + page.ieplr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page InterfaceEndpointProfilesListResultPage) NotDone() bool { + return !page.ieplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +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 InterfaceEndpointProfilesListResultPage) Values() []InterfaceEndpointProfile { + if page.ieplr.IsEmpty() { + return nil + } + return *page.ieplr.Value +} + // LicenseTypeCapability the license type capability type LicenseTypeCapability struct { // Name - License type identifier.