diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/CHANGELOG.md b/services/postgresql/mgmt/2020-01-01/postgresql/CHANGELOG.md new file mode 100644 index 000000000000..e5d7a6807b43 --- /dev/null +++ b/services/postgresql/mgmt/2020-01-01/postgresql/CHANGELOG.md @@ -0,0 +1,10 @@ +Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82 + +Code generator @microsoft.azure/autorest.go@~2.1.161 + +## Breaking Changes + +- Function `NewPrivateLinkResourceListResultPage` parameter(s) have been changed from `(func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error))` to `(PrivateLinkResourceListResult, func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error))` +- Function `NewPrivateEndpointConnectionListResultPage` parameter(s) have been changed from `(func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error))` to `(PrivateEndpointConnectionListResult, func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error))` +- Function `NewServerKeyListResultPage` parameter(s) have been changed from `(func(context.Context, ServerKeyListResult) (ServerKeyListResult, error))` to `(ServerKeyListResult, func(context.Context, ServerKeyListResult) (ServerKeyListResult, error))` +- Function `NewVirtualNetworkRuleListResultPage` parameter(s) have been changed from `(func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error))` to `(VirtualNetworkRuleListResult, func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error))` diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/checknameavailability.go b/services/postgresql/mgmt/2020-01-01/postgresql/checknameavailability.go index c8a80c07bd86..3b6113c7e4e5 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/checknameavailability.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/checknameavailability.go @@ -83,6 +83,7 @@ func (client CheckNameAvailabilityClient) Execute(ctx context.Context, nameAvail result, err = client.ExecuteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.CheckNameAvailabilityClient", "Execute", resp, "Failure responding to request") + return } return @@ -103,7 +104,7 @@ func (client CheckNameAvailabilityClient) ExecutePreparer(ctx context.Context, n autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/checkNameAvailability", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSQL/checkNameAvailability", pathParameters), autorest.WithJSON(nameAvailabilityRequest), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/configurations.go b/services/postgresql/mgmt/2020-01-01/postgresql/configurations.go index 9133debc9308..7def0655b033 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/configurations.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/configurations.go @@ -104,7 +104,7 @@ func (client ConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, r autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations/{configurationName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/configurations/{configurationName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -176,6 +176,7 @@ func (client ConfigurationsClient) Get(ctx context.Context, resourceGroupName st result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ConfigurationsClient", "Get", resp, "Failure responding to request") + return } return @@ -198,7 +199,7 @@ func (client ConfigurationsClient) GetPreparer(ctx context.Context, resourceGrou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations/{configurationName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/configurations/{configurationName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -262,6 +263,7 @@ func (client ConfigurationsClient) ListByServer(ctx context.Context, resourceGro result, err = client.ListByServerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ConfigurationsClient", "ListByServer", resp, "Failure responding to request") + return } return @@ -283,7 +285,7 @@ func (client ConfigurationsClient) ListByServerPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/configurations", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/databases.go b/services/postgresql/mgmt/2020-01-01/postgresql/databases.go index c0d81f2b24ca..5aea5184358a 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/databases.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/databases.go @@ -104,7 +104,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/databases/{databaseName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -192,7 +192,7 @@ func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupN preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/databases/{databaseName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -262,6 +262,7 @@ func (client DatabasesClient) Get(ctx context.Context, resourceGroupName string, result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.DatabasesClient", "Get", resp, "Failure responding to request") + return } return @@ -284,7 +285,7 @@ func (client DatabasesClient) GetPreparer(ctx context.Context, resourceGroupName preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/databases/{databaseName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -348,6 +349,7 @@ func (client DatabasesClient) ListByServer(ctx context.Context, resourceGroupNam result, err = client.ListByServerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.DatabasesClient", "ListByServer", resp, "Failure responding to request") + return } return @@ -369,7 +371,7 @@ func (client DatabasesClient) ListByServerPreparer(ctx context.Context, resource preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/databases", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/firewallrules.go b/services/postgresql/mgmt/2020-01-01/postgresql/firewallrules.go index 08f8b55e38a9..f4c64143d128 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/firewallrules.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/firewallrules.go @@ -111,7 +111,7 @@ func (client FirewallRulesClient) CreateOrUpdatePreparer(ctx context.Context, re autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -199,7 +199,7 @@ func (client FirewallRulesClient) DeletePreparer(ctx context.Context, resourceGr preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -269,6 +269,7 @@ func (client FirewallRulesClient) Get(ctx context.Context, resourceGroupName str result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesClient", "Get", resp, "Failure responding to request") + return } return @@ -291,7 +292,7 @@ func (client FirewallRulesClient) GetPreparer(ctx context.Context, resourceGroup preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -355,6 +356,7 @@ func (client FirewallRulesClient) ListByServer(ctx context.Context, resourceGrou result, err = client.ListByServerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesClient", "ListByServer", resp, "Failure responding to request") + return } return @@ -376,7 +378,7 @@ func (client FirewallRulesClient) ListByServerPreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/firewallRules", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/locationbasedperformancetier.go b/services/postgresql/mgmt/2020-01-01/postgresql/locationbasedperformancetier.go index 0028238399a8..279a5bb0b18c 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/locationbasedperformancetier.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/locationbasedperformancetier.go @@ -81,6 +81,7 @@ func (client LocationBasedPerformanceTierClient) List(ctx context.Context, locat result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.LocationBasedPerformanceTierClient", "List", resp, "Failure responding to request") + return } return @@ -101,7 +102,7 @@ func (client LocationBasedPerformanceTierClient) ListPreparer(ctx context.Contex preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/performanceTiers", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSQL/locations/{locationName}/performanceTiers", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/logfiles.go b/services/postgresql/mgmt/2020-01-01/postgresql/logfiles.go index 7423fdaf2fee..c9ccdea6813d 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/logfiles.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/logfiles.go @@ -85,6 +85,7 @@ func (client LogFilesClient) ListByServer(ctx context.Context, resourceGroupName result, err = client.ListByServerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.LogFilesClient", "ListByServer", resp, "Failure responding to request") + return } return @@ -106,7 +107,7 @@ func (client LogFilesClient) ListByServerPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/logFiles", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/logFiles", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/models.go b/services/postgresql/mgmt/2020-01-01/postgresql/models.go index 1fd32d6bd1cd..c9d13542671f 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/models.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/models.go @@ -32,15 +32,15 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2020-01-01/postgresql" -// AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag. +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. type AzureEntityResource struct { // Etag - READ-ONLY; Resource Etag. Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -54,11 +54,11 @@ type Configuration struct { autorest.Response `json:"-"` // ConfigurationProperties - The properties of a configuration. *ConfigurationProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -191,11 +191,11 @@ type Database struct { autorest.Response `json:"-"` // DatabaseProperties - The properties of a database. *DatabaseProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -303,7 +303,8 @@ func (future *DatabasesCreateOrUpdateFuture) Result(client DatabasesClient) (d D return } -// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DatabasesDeleteFuture struct { azure.Future } @@ -333,7 +334,8 @@ type ErrorAdditionalInfo struct { Info interface{} `json:"info,omitempty"` } -// ErrorResponse the resource management error response. +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.) type ErrorResponse struct { // Code - READ-ONLY; The error code. Code *string `json:"code,omitempty"` @@ -352,11 +354,11 @@ type FirewallRule struct { autorest.Response `json:"-"` // FirewallRuleProperties - The properties of a firewall rule. *FirewallRuleProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -435,8 +437,8 @@ type FirewallRuleProperties struct { EndIPAddress *string `json:"endIpAddress,omitempty"` } -// FirewallRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// FirewallRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type FirewallRulesCreateOrUpdateFuture struct { azure.Future } @@ -491,11 +493,11 @@ func (future *FirewallRulesDeleteFuture) Result(client FirewallRulesClient) (ar type LogFile struct { // LogFileProperties - The properties of the log file. *LogFileProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -662,6 +664,18 @@ type PerformanceTierListResult struct { type PerformanceTierProperties struct { // ID - ID of the performance tier. ID *string `json:"id,omitempty"` + // MaxBackupRetentionDays - Maximum Backup retention in days for the performance tier edition + MaxBackupRetentionDays *int32 `json:"maxBackupRetentionDays,omitempty"` + // MinBackupRetentionDays - Minimum Backup retention in days for the performance tier edition + MinBackupRetentionDays *int32 `json:"minBackupRetentionDays,omitempty"` + // MaxStorageMB - Max storage allowed for a server. + MaxStorageMB *int32 `json:"maxStorageMB,omitempty"` + // MinLargeStorageMB - Max storage allowed for a server. + MinLargeStorageMB *int32 `json:"minLargeStorageMB,omitempty"` + // MaxLargeStorageMB - Max storage allowed for a server. + MaxLargeStorageMB *int32 `json:"maxLargeStorageMB,omitempty"` + // MinStorageMB - Max storage allowed for a server. + MinStorageMB *int32 `json:"minStorageMB,omitempty"` // ServiceLevelObjectives - Service level objectives associated with the performance tier ServiceLevelObjectives *[]PerformanceTierServiceLevelObjectives `json:"serviceLevelObjectives,omitempty"` } @@ -691,11 +705,11 @@ type PrivateEndpointConnection struct { autorest.Response `json:"-"` // PrivateEndpointConnectionProperties - Resource properties. *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -912,8 +926,11 @@ func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointCo } // Creates a new instance of the PrivateEndpointConnectionListResultPage type. -func NewPrivateEndpointConnectionListResultPage(getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { - return PrivateEndpointConnectionListResultPage{fn: getNextPage} +func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { + return PrivateEndpointConnectionListResultPage{ + fn: getNextPage, + peclr: cur, + } } // PrivateEndpointConnectionProperties properties of a private endpoint connection. @@ -938,8 +955,8 @@ func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type PrivateEndpointConnectionsCreateOrUpdateFuture struct { azure.Future } @@ -1030,11 +1047,11 @@ type PrivateLinkResource struct { autorest.Response `json:"-"` // Properties - READ-ONLY; The private link resource group id. Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -1047,7 +1064,8 @@ type PrivateLinkResourceListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource values. +// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource +// values. type PrivateLinkResourceListResultIterator struct { i int page PrivateLinkResourceListResultPage @@ -1190,8 +1208,11 @@ func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource { } // Creates a new instance of the PrivateLinkResourceListResultPage type. -func NewPrivateLinkResourceListResultPage(getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage { - return PrivateLinkResourceListResultPage{fn: getNextPage} +func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage { + return PrivateLinkResourceListResultPage{ + fn: getNextPage, + plrlr: cur, + } } // PrivateLinkResourceProperties properties of a private link resource. @@ -1224,24 +1245,113 @@ func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, e return json.Marshal(objectMap) } -// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than -// required location and tags +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location type ProxyResource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } -// Resource ... +// RecoverableServerProperties the recoverable server's properties. +type RecoverableServerProperties struct { + // LastAvailableBackupDateTime - READ-ONLY; The last available backup date time. + LastAvailableBackupDateTime *string `json:"lastAvailableBackupDateTime,omitempty"` + // ServiceLevelObjective - READ-ONLY; The service level objective + ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"` + // Edition - READ-ONLY; Edition of the performance tier. + Edition *string `json:"edition,omitempty"` + // VCore - READ-ONLY; vCore associated with the service level objective + VCore *int32 `json:"vCore,omitempty"` + // HardwareGeneration - READ-ONLY; Hardware generation associated with the service level objective + HardwareGeneration *string `json:"hardwareGeneration,omitempty"` + // Version - READ-ONLY; The PostgreSQL version + Version *string `json:"version,omitempty"` +} + +// RecoverableServerResource a recoverable server resource. +type RecoverableServerResource struct { + autorest.Response `json:"-"` + // RecoverableServerProperties - Resource properties. + *RecoverableServerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoverableServerResource. +func (rsr RecoverableServerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsr.RecoverableServerProperties != nil { + objectMap["properties"] = rsr.RecoverableServerProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RecoverableServerResource struct. +func (rsr *RecoverableServerResource) 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 recoverableServerProperties RecoverableServerProperties + err = json.Unmarshal(*v, &recoverableServerProperties) + if err != nil { + return err + } + rsr.RecoverableServerProperties = &recoverableServerProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rsr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rsr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rsr.Type = &typeVar + } + } + } + + return nil +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -1295,11 +1405,11 @@ type Server struct { Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -1428,11 +1538,11 @@ type ServerAdministratorResource struct { autorest.Response `json:"-"` // ServerAdministratorProperties - Properties of the server AAD administrator. *ServerAdministratorProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -1532,8 +1642,8 @@ func (future *ServerAdministratorsCreateOrUpdateFuture) Result(client ServerAdmi return } -// ServerAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ServerAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ServerAdministratorsDeleteFuture struct { azure.Future } @@ -1654,11 +1764,11 @@ type ServerKey struct { Kind *string `json:"kind,omitempty"` // ServerKeyProperties - Properties of the ServerKey Resource. *ServerKeyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -1883,8 +1993,11 @@ func (page ServerKeyListResultPage) Values() []ServerKey { } // Creates a new instance of the ServerKeyListResultPage type. -func NewServerKeyListResultPage(getNextPage func(context.Context, ServerKeyListResult) (ServerKeyListResult, error)) ServerKeyListResultPage { - return ServerKeyListResultPage{fn: getNextPage} +func NewServerKeyListResultPage(cur ServerKeyListResult, getNextPage func(context.Context, ServerKeyListResult) (ServerKeyListResult, error)) ServerKeyListResultPage { + return ServerKeyListResultPage{ + fn: getNextPage, + sklr: cur, + } } // ServerKeyProperties properties for a key execution. @@ -1909,8 +2022,8 @@ func (skp ServerKeyProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ServerKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ServerKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ServerKeysCreateOrUpdateFuture struct { azure.Future } @@ -1938,7 +2051,8 @@ func (future *ServerKeysCreateOrUpdateFuture) Result(client ServerKeysClient) (s return } -// ServerKeysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServerKeysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServerKeysDeleteFuture struct { azure.Future } @@ -1967,6 +2081,35 @@ type ServerListResult struct { Value *[]Server `json:"value,omitempty"` } +// ServerParametersListUpdateConfigurationsFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ServerParametersListUpdateConfigurationsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServerParametersListUpdateConfigurationsFuture) Result(client ServerParametersClient) (clr ConfigurationListResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerParametersListUpdateConfigurationsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("postgresql.ServerParametersListUpdateConfigurationsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if clr.Response.Response, err = future.GetResult(sender); err == nil && clr.Response.Response.StatusCode != http.StatusNoContent { + clr, err = client.ListUpdateConfigurationsResponder(clr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerParametersListUpdateConfigurationsFuture", "Result", clr.Response.Response, "Failure responding to request") + } + } + return +} + // ServerPrivateEndpointConnection a private endpoint connection under a server type ServerPrivateEndpointConnection struct { // ID - READ-ONLY; Resource ID of the Private Endpoint Connection. @@ -2318,8 +2461,8 @@ func (spfdc ServerPropertiesForDefaultCreate) AsBasicServerPropertiesForCreate() return &spfdc, true } -// ServerPropertiesForGeoRestore the properties used to create a new server by restoring to a different region -// from a geo replicated backup. +// ServerPropertiesForGeoRestore the properties used to create a new server by restoring to a different +// region from a geo replicated backup. type ServerPropertiesForGeoRestore struct { // SourceServerID - The source server id to restore from. SourceServerID *string `json:"sourceServerId,omitempty"` @@ -2567,7 +2710,8 @@ func (spfr ServerPropertiesForRestore) AsBasicServerPropertiesForCreate() (Basic return &spfr, true } -// ServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServersCreateFuture struct { azure.Future } @@ -2595,7 +2739,8 @@ func (future *ServersCreateFuture) Result(client ServersClient) (s Server, err e return } -// ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServersDeleteFuture struct { azure.Future } @@ -2617,8 +2762,8 @@ func (future *ServersDeleteFuture) Result(client ServersClient) (ar autorest.Res return } -// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type ServerSecurityAlertPoliciesCreateOrUpdateFuture struct { azure.Future } @@ -2651,11 +2796,11 @@ type ServerSecurityAlertPolicy struct { autorest.Response `json:"-"` // SecurityAlertPolicyProperties - Resource properties. *SecurityAlertPolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -2719,7 +2864,8 @@ func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { return nil } -// ServersRestartFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServersRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServersRestartFuture struct { azure.Future } @@ -2741,7 +2887,8 @@ func (future *ServersRestartFuture) Result(client ServersClient) (ar autorest.Re return } -// ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServersUpdateFuture struct { azure.Future } @@ -2909,17 +3056,18 @@ func (toVar TagsObject) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// TrackedResource the resource model definition for a ARM tracked top level resource +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' type TrackedResource struct { // Tags - Resource tags. Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -2940,11 +3088,11 @@ type VirtualNetworkRule struct { autorest.Response `json:"-"` // VirtualNetworkRuleProperties - Resource properties. *VirtualNetworkRuleProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -3160,8 +3308,11 @@ func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule { } // Creates a new instance of the VirtualNetworkRuleListResultPage type. -func NewVirtualNetworkRuleListResultPage(getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage { - return VirtualNetworkRuleListResultPage{fn: getNextPage} +func NewVirtualNetworkRuleListResultPage(cur VirtualNetworkRuleListResult, getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage { + return VirtualNetworkRuleListResultPage{ + fn: getNextPage, + vnrlr: cur, + } } // VirtualNetworkRuleProperties properties of a virtual network rule. @@ -3215,8 +3366,8 @@ func (future *VirtualNetworkRulesCreateOrUpdateFuture) Result(client VirtualNetw return } -// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualNetworkRulesDeleteFuture struct { azure.Future } diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/operations.go b/services/postgresql/mgmt/2020-01-01/postgresql/operations.go index 7506e45631cc..f54633384eca 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/operations.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/operations.go @@ -71,6 +71,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.OperationsClient", "List", resp, "Failure responding to request") + return } return @@ -86,7 +87,7 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.DBforPostgreSQL/operations"), + autorest.WithPath("/providers/Microsoft.DBForPostgreSQL/operations"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/postgresqlapi/interfaces.go b/services/postgresql/mgmt/2020-01-01/postgresql/postgresqlapi/interfaces.go index b5e09132bd18..872d4ce1df43 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/postgresqlapi/interfaces.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/postgresqlapi/interfaces.go @@ -82,6 +82,13 @@ type ConfigurationsClientAPI interface { var _ ConfigurationsClientAPI = (*postgresql.ConfigurationsClient)(nil) +// ServerParametersClientAPI contains the set of methods on the ServerParametersClient type. +type ServerParametersClientAPI interface { + ListUpdateConfigurations(ctx context.Context, resourceGroupName string, serverName string, value postgresql.ConfigurationListResult) (result postgresql.ServerParametersListUpdateConfigurationsFuture, err error) +} + +var _ ServerParametersClientAPI = (*postgresql.ServerParametersClient)(nil) + // LogFilesClientAPI contains the set of methods on the LogFilesClient type. type LogFilesClientAPI interface { ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.LogFileListResult, err error) @@ -99,6 +106,20 @@ type ServerAdministratorsClientAPI interface { var _ ServerAdministratorsClientAPI = (*postgresql.ServerAdministratorsClient)(nil) +// RecoverableServersClientAPI contains the set of methods on the RecoverableServersClient type. +type RecoverableServersClientAPI interface { + Get(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.RecoverableServerResource, err error) +} + +var _ RecoverableServersClientAPI = (*postgresql.RecoverableServersClient)(nil) + +// ServerBasedPerformanceTierClientAPI contains the set of methods on the ServerBasedPerformanceTierClient type. +type ServerBasedPerformanceTierClientAPI interface { + List(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.PerformanceTierListResult, err error) +} + +var _ ServerBasedPerformanceTierClientAPI = (*postgresql.ServerBasedPerformanceTierClient)(nil) + // LocationBasedPerformanceTierClientAPI contains the set of methods on the LocationBasedPerformanceTierClient type. type LocationBasedPerformanceTierClientAPI interface { List(ctx context.Context, locationName string) (result postgresql.PerformanceTierListResult, err error) diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/privateendpointconnections.go b/services/postgresql/mgmt/2020-01-01/postgresql/privateendpointconnections.go index 8bc5bc8c756b..901b40647cd7 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/privateendpointconnections.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/privateendpointconnections.go @@ -267,6 +267,7 @@ func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resource result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + return } return @@ -354,9 +355,11 @@ func (client PrivateEndpointConnectionsClient) ListByServer(ctx context.Context, result.peclr, err = client.ListByServerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.PrivateEndpointConnectionsClient", "ListByServer", resp, "Failure responding to request") + return } if result.peclr.hasNextLink() && result.peclr.IsEmpty() { err = result.NextWithContext(ctx) + return } return diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/privatelinkresources.go b/services/postgresql/mgmt/2020-01-01/postgresql/privatelinkresources.go index 402e8582ad64..06b859a79796 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/privatelinkresources.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/privatelinkresources.go @@ -87,6 +87,7 @@ func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupN result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.PrivateLinkResourcesClient", "Get", resp, "Failure responding to request") + return } return @@ -174,9 +175,11 @@ func (client PrivateLinkResourcesClient) ListByServer(ctx context.Context, resou result.plrlr, err = client.ListByServerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.PrivateLinkResourcesClient", "ListByServer", resp, "Failure responding to request") + return } if result.plrlr.hasNextLink() && result.plrlr.IsEmpty() { err = result.NextWithContext(ctx) + return } return diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/recoverableservers.go b/services/postgresql/mgmt/2020-01-01/postgresql/recoverableservers.go new file mode 100644 index 000000000000..402007a728df --- /dev/null +++ b/services/postgresql/mgmt/2020-01-01/postgresql/recoverableservers.go @@ -0,0 +1,132 @@ +package postgresql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RecoverableServersClient is the the Microsoft Azure management API provides create, read, update, and delete +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security +// alert policies, log files and configurations with new business model. +type RecoverableServersClient struct { + BaseClient +} + +// NewRecoverableServersClient creates an instance of the RecoverableServersClient client. +func NewRecoverableServersClient(subscriptionID string) RecoverableServersClient { + return NewRecoverableServersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRecoverableServersClientWithBaseURI creates an instance of the RecoverableServersClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewRecoverableServersClientWithBaseURI(baseURI string, subscriptionID string) RecoverableServersClient { + return RecoverableServersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a recoverable PostgreSQL Server. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// serverName - the name of the server. +func (client RecoverableServersClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result RecoverableServerResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableServersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("postgresql.RecoverableServersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.RecoverableServersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "postgresql.RecoverableServersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.RecoverableServersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RecoverableServersClient) GetPreparer(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-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/recoverableServers", 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 RecoverableServersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RecoverableServersClient) GetResponder(resp *http.Response) (result RecoverableServerResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/replicas.go b/services/postgresql/mgmt/2020-01-01/postgresql/replicas.go index 6a3c6894372f..eaa793d990c5 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/replicas.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/replicas.go @@ -85,6 +85,7 @@ func (client ReplicasClient) ListByServer(ctx context.Context, resourceGroupName result, err = client.ListByServerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ReplicasClient", "ListByServer", resp, "Failure responding to request") + return } return @@ -106,7 +107,7 @@ func (client ReplicasClient) ListByServerPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/Replicas", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/Replicas", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/serveradministrators.go b/services/postgresql/mgmt/2020-01-01/postgresql/serveradministrators.go index 9603a6dc2cc8..ab4b822cce54 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/serveradministrators.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/serveradministrators.go @@ -111,7 +111,7 @@ func (client ServerAdministratorsClient) CreateOrUpdatePreparer(ctx context.Cont autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/Administrators/activeDirectory", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/Administrators/activeDirectory", pathParameters), autorest.WithJSON(properties), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -197,7 +197,7 @@ func (client ServerAdministratorsClient) DeletePreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/Administrators/activeDirectory", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/Administrators/activeDirectory", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -266,6 +266,7 @@ func (client ServerAdministratorsClient) Get(ctx context.Context, resourceGroupN result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "Get", resp, "Failure responding to request") + return } return @@ -287,7 +288,7 @@ func (client ServerAdministratorsClient) GetPreparer(ctx context.Context, resour preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/Administrators/activeDirectory", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/Administrators/activeDirectory", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -351,6 +352,7 @@ func (client ServerAdministratorsClient) List(ctx context.Context, resourceGroup result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "List", resp, "Failure responding to request") + return } return @@ -372,7 +374,7 @@ func (client ServerAdministratorsClient) ListPreparer(ctx context.Context, resou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/administrators", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/administrators", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/serverbasedperformancetier.go b/services/postgresql/mgmt/2020-01-01/postgresql/serverbasedperformancetier.go new file mode 100644 index 000000000000..0b4af087d72f --- /dev/null +++ b/services/postgresql/mgmt/2020-01-01/postgresql/serverbasedperformancetier.go @@ -0,0 +1,132 @@ +package postgresql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ServerBasedPerformanceTierClient is the the Microsoft Azure management API provides create, read, update, and delete +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security +// alert policies, log files and configurations with new business model. +type ServerBasedPerformanceTierClient struct { + BaseClient +} + +// NewServerBasedPerformanceTierClient creates an instance of the ServerBasedPerformanceTierClient client. +func NewServerBasedPerformanceTierClient(subscriptionID string) ServerBasedPerformanceTierClient { + return NewServerBasedPerformanceTierClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServerBasedPerformanceTierClientWithBaseURI creates an instance of the ServerBasedPerformanceTierClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewServerBasedPerformanceTierClientWithBaseURI(baseURI string, subscriptionID string) ServerBasedPerformanceTierClient { + return ServerBasedPerformanceTierClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List list all the performance tiers for a PostgreSQL server. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// serverName - the name of the server. +func (client ServerBasedPerformanceTierClient) List(ctx context.Context, resourceGroupName string, serverName string) (result PerformanceTierListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerBasedPerformanceTierClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("postgresql.ServerBasedPerformanceTierClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerBasedPerformanceTierClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "postgresql.ServerBasedPerformanceTierClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerBasedPerformanceTierClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ServerBasedPerformanceTierClient) ListPreparer(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-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/performanceTiers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ServerBasedPerformanceTierClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ServerBasedPerformanceTierClient) ListResponder(resp *http.Response) (result PerformanceTierListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/serverkeys.go b/services/postgresql/mgmt/2020-01-01/postgresql/serverkeys.go index 26c18e5938d1..3167184c6942 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/serverkeys.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/serverkeys.go @@ -266,6 +266,7 @@ func (client ServerKeysClient) Get(ctx context.Context, resourceGroupName string result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ServerKeysClient", "Get", resp, "Failure responding to request") + return } return @@ -353,9 +354,11 @@ func (client ServerKeysClient) List(ctx context.Context, resourceGroupName strin result.sklr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ServerKeysClient", "List", resp, "Failure responding to request") + return } if result.sklr.hasNextLink() && result.sklr.IsEmpty() { err = result.NextWithContext(ctx) + return } return diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/serverparameters.go b/services/postgresql/mgmt/2020-01-01/postgresql/serverparameters.go new file mode 100644 index 000000000000..4503fb9d672e --- /dev/null +++ b/services/postgresql/mgmt/2020-01-01/postgresql/serverparameters.go @@ -0,0 +1,134 @@ +package postgresql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ServerParametersClient is the the Microsoft Azure management API provides create, read, update, and delete +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security +// alert policies, log files and configurations with new business model. +type ServerParametersClient struct { + BaseClient +} + +// NewServerParametersClient creates an instance of the ServerParametersClient client. +func NewServerParametersClient(subscriptionID string) ServerParametersClient { + return NewServerParametersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServerParametersClientWithBaseURI creates an instance of the ServerParametersClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewServerParametersClientWithBaseURI(baseURI string, subscriptionID string) ServerParametersClient { + return ServerParametersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListUpdateConfigurations update a list of configurations in a given server. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// serverName - the name of the server. +// value - the parameters for updating a list of server configuration. +func (client ServerParametersClient) ListUpdateConfigurations(ctx context.Context, resourceGroupName string, serverName string, value ConfigurationListResult) (result ServerParametersListUpdateConfigurationsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerParametersClient.ListUpdateConfigurations") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("postgresql.ServerParametersClient", "ListUpdateConfigurations", err.Error()) + } + + req, err := client.ListUpdateConfigurationsPreparer(ctx, resourceGroupName, serverName, value) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerParametersClient", "ListUpdateConfigurations", nil, "Failure preparing request") + return + } + + result, err = client.ListUpdateConfigurationsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerParametersClient", "ListUpdateConfigurations", result.Response(), "Failure sending request") + return + } + + return +} + +// ListUpdateConfigurationsPreparer prepares the ListUpdateConfigurations request. +func (client ServerParametersClient) ListUpdateConfigurationsPreparer(ctx context.Context, resourceGroupName string, serverName string, value ConfigurationListResult) (*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-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/updateConfigurations", pathParameters), + autorest.WithJSON(value), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUpdateConfigurationsSender sends the ListUpdateConfigurations request. The method will close the +// http.Response Body if it receives an error. +func (client ServerParametersClient) ListUpdateConfigurationsSender(req *http.Request) (future ServerParametersListUpdateConfigurationsFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ListUpdateConfigurationsResponder handles the response to the ListUpdateConfigurations request. The method always +// closes the http.Response Body. +func (client ServerParametersClient) ListUpdateConfigurationsResponder(resp *http.Response) (result ConfigurationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/servers.go b/services/postgresql/mgmt/2020-01-01/postgresql/servers.go index c5f7f4573d1a..22dbc0637b4e 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/servers.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/servers.go @@ -69,10 +69,10 @@ func (client ServersClient) Create(ctx context.Context, resourceGroupName string {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, + Chain: []validation.Constraint{{Target: "parameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Sku.Capacity", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, }}, - {Target: "parameters.Properties", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("postgresql.ServersClient", "Create", err.Error()) } @@ -109,7 +109,7 @@ func (client ServersClient) CreatePreparer(ctx context.Context, resourceGroupNam autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -195,7 +195,7 @@ func (client ServersClient) DeletePreparer(ctx context.Context, resourceGroupNam preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -264,6 +264,7 @@ func (client ServersClient) Get(ctx context.Context, resourceGroupName string, s result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ServersClient", "Get", resp, "Failure responding to request") + return } return @@ -285,7 +286,7 @@ func (client ServersClient) GetPreparer(ctx context.Context, resourceGroupName s preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -342,6 +343,7 @@ func (client ServersClient) List(ctx context.Context) (result ServerListResult, result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ServersClient", "List", resp, "Failure responding to request") + return } return @@ -361,7 +363,7 @@ func (client ServersClient) ListPreparer(ctx context.Context) (*http.Request, er preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/servers", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSQL/servers", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -424,6 +426,7 @@ func (client ServersClient) ListByResourceGroup(ctx context.Context, resourceGro result, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ServersClient", "ListByResourceGroup", resp, "Failure responding to request") + return } return @@ -444,7 +447,7 @@ func (client ServersClient) ListByResourceGroupPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -523,7 +526,7 @@ func (client ServersClient) RestartPreparer(ctx context.Context, resourceGroupNa preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/restart", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/restart", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -610,7 +613,7 @@ func (client ServersClient) UpdatePreparer(ctx context.Context, resourceGroupNam autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/serversecurityalertpolicies.go b/services/postgresql/mgmt/2020-01-01/postgresql/serversecurityalertpolicies.go index d491d51793e1..724ecbe80fa1 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/serversecurityalertpolicies.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/serversecurityalertpolicies.go @@ -175,6 +175,7 @@ func (client ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourc result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ServerSecurityAlertPoliciesClient", "Get", resp, "Failure responding to request") + return } return diff --git a/services/postgresql/mgmt/2020-01-01/postgresql/virtualnetworkrules.go b/services/postgresql/mgmt/2020-01-01/postgresql/virtualnetworkrules.go index fe45dc060045..b21e9cf02ce9 100644 --- a/services/postgresql/mgmt/2020-01-01/postgresql/virtualnetworkrules.go +++ b/services/postgresql/mgmt/2020-01-01/postgresql/virtualnetworkrules.go @@ -108,7 +108,7 @@ func (client VirtualNetworkRulesClient) CreateOrUpdatePreparer(ctx context.Conte autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -196,7 +196,7 @@ func (client VirtualNetworkRulesClient) DeletePreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -266,6 +266,7 @@ func (client VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupNa result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "Get", resp, "Failure responding to request") + return } return @@ -288,7 +289,7 @@ func (client VirtualNetworkRulesClient) GetPreparer(ctx context.Context, resourc preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -353,9 +354,11 @@ func (client VirtualNetworkRulesClient) ListByServer(ctx context.Context, resour result.vnrlr, err = client.ListByServerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "ListByServer", resp, "Failure responding to request") + return } if result.vnrlr.hasNextLink() && result.vnrlr.IsEmpty() { err = result.NextWithContext(ctx) + return } return @@ -377,7 +380,7 @@ func (client VirtualNetworkRulesClient) ListByServerPreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/virtualNetworkRules", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) }