diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/checknameavailability.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/checknameavailability.go index df18d400707c..5cb039d29e3e 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/checknameavailability.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/checknameavailability.go @@ -118,7 +118,6 @@ func (client CheckNameAvailabilityClient) ExecuteSender(req *http.Request) (*htt func (client CheckNameAvailabilityClient) ExecuteResponder(resp *http.Response) (result NameAvailability, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/configurations.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/configurations.go index 3794da5a4719..2e77f3d81092 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/configurations.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/configurations.go @@ -117,7 +117,6 @@ func (client ConfigurationsClient) CreateOrUpdateSender(req *http.Request) (futu func (client ConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result Configuration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -196,7 +195,6 @@ func (client ConfigurationsClient) GetSender(req *http.Request) (*http.Response, func (client ConfigurationsClient) GetResponder(resp *http.Response) (result Configuration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -273,7 +271,6 @@ func (client ConfigurationsClient) ListByServerSender(req *http.Request) (*http. func (client ConfigurationsClient) ListByServerResponder(resp *http.Response) (result ConfigurationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/databases.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/databases.go index fb04a4151104..3bc7adb549ba 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/databases.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/databases.go @@ -117,7 +117,6 @@ func (client DatabasesClient) CreateOrUpdateSender(req *http.Request) (future Da func (client DatabasesClient) CreateOrUpdateResponder(resp *http.Response) (result Database, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -196,7 +195,6 @@ func (client DatabasesClient) DeleteSender(req *http.Request) (future DatabasesD func (client DatabasesClient) 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 @@ -274,7 +272,6 @@ func (client DatabasesClient) GetSender(req *http.Request) (*http.Response, erro func (client DatabasesClient) GetResponder(resp *http.Response) (result Database, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -351,7 +348,6 @@ func (client DatabasesClient) ListByServerSender(req *http.Request) (*http.Respo func (client DatabasesClient) ListByServerResponder(resp *http.Response) (result DatabaseListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/enums.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/enums.go new file mode 100644 index 000000000000..05e572e36ef6 --- /dev/null +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/enums.go @@ -0,0 +1,313 @@ +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. + +// CreateMode enumerates the values for create mode. +type CreateMode string + +const ( + // CreateModeDefault ... + CreateModeDefault CreateMode = "Default" + // CreateModeGeoRestore ... + CreateModeGeoRestore CreateMode = "GeoRestore" + // CreateModePointInTimeRestore ... + CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" + // CreateModeReplica ... + CreateModeReplica CreateMode = "Replica" + // CreateModeServerPropertiesForCreate ... + CreateModeServerPropertiesForCreate CreateMode = "ServerPropertiesForCreate" +) + +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() []CreateMode { + return []CreateMode{CreateModeDefault, CreateModeGeoRestore, CreateModePointInTimeRestore, CreateModeReplica, CreateModeServerPropertiesForCreate} +} + +// GeoRedundantBackup enumerates the values for geo redundant backup. +type GeoRedundantBackup string + +const ( + // Disabled ... + Disabled GeoRedundantBackup = "Disabled" + // Enabled ... + Enabled GeoRedundantBackup = "Enabled" +) + +// PossibleGeoRedundantBackupValues returns an array of possible values for the GeoRedundantBackup const type. +func PossibleGeoRedundantBackupValues() []GeoRedundantBackup { + return []GeoRedundantBackup{Disabled, Enabled} +} + +// IdentityType enumerates the values for identity type. +type IdentityType string + +const ( + // SystemAssigned ... + SystemAssigned IdentityType = "SystemAssigned" +) + +// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. +func PossibleIdentityTypeValues() []IdentityType { + return []IdentityType{SystemAssigned} +} + +// InfrastructureEncryption enumerates the values for infrastructure encryption. +type InfrastructureEncryption string + +const ( + // InfrastructureEncryptionDisabled ... + InfrastructureEncryptionDisabled InfrastructureEncryption = "Disabled" + // InfrastructureEncryptionEnabled ... + InfrastructureEncryptionEnabled InfrastructureEncryption = "Enabled" +) + +// PossibleInfrastructureEncryptionValues returns an array of possible values for the InfrastructureEncryption const type. +func PossibleInfrastructureEncryptionValues() []InfrastructureEncryption { + return []InfrastructureEncryption{InfrastructureEncryptionDisabled, InfrastructureEncryptionEnabled} +} + +// MinimalTLSVersionEnum enumerates the values for minimal tls version enum. +type MinimalTLSVersionEnum string + +const ( + // TLS10 ... + TLS10 MinimalTLSVersionEnum = "TLS1_0" + // TLS11 ... + TLS11 MinimalTLSVersionEnum = "TLS1_1" + // TLS12 ... + TLS12 MinimalTLSVersionEnum = "TLS1_2" + // TLSEnforcementDisabled ... + TLSEnforcementDisabled MinimalTLSVersionEnum = "TLSEnforcementDisabled" +) + +// PossibleMinimalTLSVersionEnumValues returns an array of possible values for the MinimalTLSVersionEnum const type. +func PossibleMinimalTLSVersionEnumValues() []MinimalTLSVersionEnum { + return []MinimalTLSVersionEnum{TLS10, TLS11, TLS12, TLSEnforcementDisabled} +} + +// OperationOrigin enumerates the values for operation origin. +type OperationOrigin string + +const ( + // NotSpecified ... + NotSpecified OperationOrigin = "NotSpecified" + // System ... + System OperationOrigin = "system" + // User ... + User OperationOrigin = "user" +) + +// PossibleOperationOriginValues returns an array of possible values for the OperationOrigin const type. +func PossibleOperationOriginValues() []OperationOrigin { + return []OperationOrigin{NotSpecified, System, User} +} + +// PrivateEndpointProvisioningState enumerates the values for private endpoint provisioning state. +type PrivateEndpointProvisioningState string + +const ( + // Approving ... + Approving PrivateEndpointProvisioningState = "Approving" + // Dropping ... + Dropping PrivateEndpointProvisioningState = "Dropping" + // Failed ... + Failed PrivateEndpointProvisioningState = "Failed" + // Ready ... + Ready PrivateEndpointProvisioningState = "Ready" + // Rejecting ... + Rejecting PrivateEndpointProvisioningState = "Rejecting" +) + +// PossiblePrivateEndpointProvisioningStateValues returns an array of possible values for the PrivateEndpointProvisioningState const type. +func PossiblePrivateEndpointProvisioningStateValues() []PrivateEndpointProvisioningState { + return []PrivateEndpointProvisioningState{Approving, Dropping, Failed, Ready, Rejecting} +} + +// PrivateLinkServiceConnectionStateActionsRequire enumerates the values for private link service connection +// state actions require. +type PrivateLinkServiceConnectionStateActionsRequire string + +const ( + // None ... + None PrivateLinkServiceConnectionStateActionsRequire = "None" +) + +// PossiblePrivateLinkServiceConnectionStateActionsRequireValues returns an array of possible values for the PrivateLinkServiceConnectionStateActionsRequire const type. +func PossiblePrivateLinkServiceConnectionStateActionsRequireValues() []PrivateLinkServiceConnectionStateActionsRequire { + return []PrivateLinkServiceConnectionStateActionsRequire{None} +} + +// PrivateLinkServiceConnectionStateStatus enumerates the values for private link service connection state +// status. +type PrivateLinkServiceConnectionStateStatus string + +const ( + // Approved ... + Approved PrivateLinkServiceConnectionStateStatus = "Approved" + // Disconnected ... + Disconnected PrivateLinkServiceConnectionStateStatus = "Disconnected" + // Pending ... + Pending PrivateLinkServiceConnectionStateStatus = "Pending" + // Rejected ... + Rejected PrivateLinkServiceConnectionStateStatus = "Rejected" +) + +// PossiblePrivateLinkServiceConnectionStateStatusValues returns an array of possible values for the PrivateLinkServiceConnectionStateStatus const type. +func PossiblePrivateLinkServiceConnectionStateStatusValues() []PrivateLinkServiceConnectionStateStatus { + return []PrivateLinkServiceConnectionStateStatus{Approved, Disconnected, Pending, Rejected} +} + +// PublicNetworkAccessEnum enumerates the values for public network access enum. +type PublicNetworkAccessEnum string + +const ( + // PublicNetworkAccessEnumDisabled ... + PublicNetworkAccessEnumDisabled PublicNetworkAccessEnum = "Disabled" + // PublicNetworkAccessEnumEnabled ... + PublicNetworkAccessEnumEnabled PublicNetworkAccessEnum = "Enabled" +) + +// PossiblePublicNetworkAccessEnumValues returns an array of possible values for the PublicNetworkAccessEnum const type. +func PossiblePublicNetworkAccessEnumValues() []PublicNetworkAccessEnum { + return []PublicNetworkAccessEnum{PublicNetworkAccessEnumDisabled, PublicNetworkAccessEnumEnabled} +} + +// ServerSecurityAlertPolicyState enumerates the values for server security alert policy state. +type ServerSecurityAlertPolicyState string + +const ( + // ServerSecurityAlertPolicyStateDisabled ... + ServerSecurityAlertPolicyStateDisabled ServerSecurityAlertPolicyState = "Disabled" + // ServerSecurityAlertPolicyStateEnabled ... + ServerSecurityAlertPolicyStateEnabled ServerSecurityAlertPolicyState = "Enabled" +) + +// PossibleServerSecurityAlertPolicyStateValues returns an array of possible values for the ServerSecurityAlertPolicyState const type. +func PossibleServerSecurityAlertPolicyStateValues() []ServerSecurityAlertPolicyState { + return []ServerSecurityAlertPolicyState{ServerSecurityAlertPolicyStateDisabled, ServerSecurityAlertPolicyStateEnabled} +} + +// ServerState enumerates the values for server state. +type ServerState string + +const ( + // ServerStateDisabled ... + ServerStateDisabled ServerState = "Disabled" + // ServerStateDropping ... + ServerStateDropping ServerState = "Dropping" + // ServerStateInaccessible ... + ServerStateInaccessible ServerState = "Inaccessible" + // ServerStateReady ... + ServerStateReady ServerState = "Ready" +) + +// PossibleServerStateValues returns an array of possible values for the ServerState const type. +func PossibleServerStateValues() []ServerState { + return []ServerState{ServerStateDisabled, ServerStateDropping, ServerStateInaccessible, ServerStateReady} +} + +// ServerVersion enumerates the values for server version. +type ServerVersion string + +const ( + // NineFullStopFive ... + NineFullStopFive ServerVersion = "9.5" + // NineFullStopSix ... + NineFullStopSix ServerVersion = "9.6" + // OneOne ... + OneOne ServerVersion = "11" + // OneZero ... + OneZero ServerVersion = "10" + // OneZeroFullStopTwo ... + OneZeroFullStopTwo ServerVersion = "10.2" + // OneZeroFullStopZero ... + OneZeroFullStopZero ServerVersion = "10.0" +) + +// PossibleServerVersionValues returns an array of possible values for the ServerVersion const type. +func PossibleServerVersionValues() []ServerVersion { + return []ServerVersion{NineFullStopFive, NineFullStopSix, OneOne, OneZero, OneZeroFullStopTwo, OneZeroFullStopZero} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // Basic ... + Basic SkuTier = "Basic" + // GeneralPurpose ... + GeneralPurpose SkuTier = "GeneralPurpose" + // MemoryOptimized ... + MemoryOptimized SkuTier = "MemoryOptimized" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{Basic, GeneralPurpose, MemoryOptimized} +} + +// SslEnforcementEnum enumerates the values for ssl enforcement enum. +type SslEnforcementEnum string + +const ( + // SslEnforcementEnumDisabled ... + SslEnforcementEnumDisabled SslEnforcementEnum = "Disabled" + // SslEnforcementEnumEnabled ... + SslEnforcementEnumEnabled SslEnforcementEnum = "Enabled" +) + +// PossibleSslEnforcementEnumValues returns an array of possible values for the SslEnforcementEnum const type. +func PossibleSslEnforcementEnumValues() []SslEnforcementEnum { + return []SslEnforcementEnum{SslEnforcementEnumDisabled, SslEnforcementEnumEnabled} +} + +// StorageAutogrow enumerates the values for storage autogrow. +type StorageAutogrow string + +const ( + // StorageAutogrowDisabled ... + StorageAutogrowDisabled StorageAutogrow = "Disabled" + // StorageAutogrowEnabled ... + StorageAutogrowEnabled StorageAutogrow = "Enabled" +) + +// PossibleStorageAutogrowValues returns an array of possible values for the StorageAutogrow const type. +func PossibleStorageAutogrowValues() []StorageAutogrow { + return []StorageAutogrow{StorageAutogrowDisabled, StorageAutogrowEnabled} +} + +// VirtualNetworkRuleState enumerates the values for virtual network rule state. +type VirtualNetworkRuleState string + +const ( + // VirtualNetworkRuleStateDeleting ... + VirtualNetworkRuleStateDeleting VirtualNetworkRuleState = "Deleting" + // VirtualNetworkRuleStateInitializing ... + VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = "Initializing" + // VirtualNetworkRuleStateInProgress ... + VirtualNetworkRuleStateInProgress VirtualNetworkRuleState = "InProgress" + // VirtualNetworkRuleStateReady ... + VirtualNetworkRuleStateReady VirtualNetworkRuleState = "Ready" + // VirtualNetworkRuleStateUnknown ... + VirtualNetworkRuleStateUnknown VirtualNetworkRuleState = "Unknown" +) + +// PossibleVirtualNetworkRuleStateValues returns an array of possible values for the VirtualNetworkRuleState const type. +func PossibleVirtualNetworkRuleStateValues() []VirtualNetworkRuleState { + return []VirtualNetworkRuleState{VirtualNetworkRuleStateDeleting, VirtualNetworkRuleStateInitializing, VirtualNetworkRuleStateInProgress, VirtualNetworkRuleStateReady, VirtualNetworkRuleStateUnknown} +} diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/firewallrules.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/firewallrules.go index 3efe385d153b..c6b839af65f4 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/firewallrules.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/firewallrules.go @@ -129,7 +129,6 @@ func (client FirewallRulesClient) CreateOrUpdateSender(req *http.Request) (futur func (client FirewallRulesClient) CreateOrUpdateResponder(resp *http.Response) (result FirewallRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -208,7 +207,6 @@ func (client FirewallRulesClient) DeleteSender(req *http.Request) (future Firewa func (client FirewallRulesClient) 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 @@ -286,7 +284,6 @@ func (client FirewallRulesClient) GetSender(req *http.Request) (*http.Response, func (client FirewallRulesClient) GetResponder(resp *http.Response) (result FirewallRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -363,7 +360,6 @@ func (client FirewallRulesClient) ListByServerSender(req *http.Request) (*http.R func (client FirewallRulesClient) ListByServerResponder(resp *http.Response) (result FirewallRuleListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/locationbasedperformancetier.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/locationbasedperformancetier.go index 7d334655c37b..043573815490 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/locationbasedperformancetier.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/locationbasedperformancetier.go @@ -110,7 +110,6 @@ func (client LocationBasedPerformanceTierClient) ListSender(req *http.Request) ( func (client LocationBasedPerformanceTierClient) ListResponder(resp *http.Response) (result PerformanceTierListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/logfiles.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/logfiles.go index 4350ae0d44e2..e32269673e99 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/logfiles.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/logfiles.go @@ -112,7 +112,6 @@ func (client LogFilesClient) ListByServerSender(req *http.Request) (*http.Respon func (client LogFilesClient) ListByServerResponder(resp *http.Response) (result LogFileListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/models.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/models.go index 41249399842b..1c4c613b68fd 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/models.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/models.go @@ -32,195 +32,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql" -// CreateMode enumerates the values for create mode. -type CreateMode string - -const ( - // CreateModeDefault ... - CreateModeDefault CreateMode = "Default" - // CreateModeGeoRestore ... - CreateModeGeoRestore CreateMode = "GeoRestore" - // CreateModePointInTimeRestore ... - CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" - // CreateModeReplica ... - CreateModeReplica CreateMode = "Replica" - // CreateModeServerPropertiesForCreate ... - CreateModeServerPropertiesForCreate CreateMode = "ServerPropertiesForCreate" -) - -// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. -func PossibleCreateModeValues() []CreateMode { - return []CreateMode{CreateModeDefault, CreateModeGeoRestore, CreateModePointInTimeRestore, CreateModeReplica, CreateModeServerPropertiesForCreate} -} - -// GeoRedundantBackup enumerates the values for geo redundant backup. -type GeoRedundantBackup string - -const ( - // Disabled ... - Disabled GeoRedundantBackup = "Disabled" - // Enabled ... - Enabled GeoRedundantBackup = "Enabled" -) - -// PossibleGeoRedundantBackupValues returns an array of possible values for the GeoRedundantBackup const type. -func PossibleGeoRedundantBackupValues() []GeoRedundantBackup { - return []GeoRedundantBackup{Disabled, Enabled} -} - -// IdentityType enumerates the values for identity type. -type IdentityType string - -const ( - // SystemAssigned ... - SystemAssigned IdentityType = "SystemAssigned" -) - -// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. -func PossibleIdentityTypeValues() []IdentityType { - return []IdentityType{SystemAssigned} -} - -// OperationOrigin enumerates the values for operation origin. -type OperationOrigin string - -const ( - // NotSpecified ... - NotSpecified OperationOrigin = "NotSpecified" - // System ... - System OperationOrigin = "system" - // User ... - User OperationOrigin = "user" -) - -// PossibleOperationOriginValues returns an array of possible values for the OperationOrigin const type. -func PossibleOperationOriginValues() []OperationOrigin { - return []OperationOrigin{NotSpecified, System, User} -} - -// ServerSecurityAlertPolicyState enumerates the values for server security alert policy state. -type ServerSecurityAlertPolicyState string - -const ( - // ServerSecurityAlertPolicyStateDisabled ... - ServerSecurityAlertPolicyStateDisabled ServerSecurityAlertPolicyState = "Disabled" - // ServerSecurityAlertPolicyStateEnabled ... - ServerSecurityAlertPolicyStateEnabled ServerSecurityAlertPolicyState = "Enabled" -) - -// PossibleServerSecurityAlertPolicyStateValues returns an array of possible values for the ServerSecurityAlertPolicyState const type. -func PossibleServerSecurityAlertPolicyStateValues() []ServerSecurityAlertPolicyState { - return []ServerSecurityAlertPolicyState{ServerSecurityAlertPolicyStateDisabled, ServerSecurityAlertPolicyStateEnabled} -} - -// ServerState enumerates the values for server state. -type ServerState string - -const ( - // ServerStateDisabled ... - ServerStateDisabled ServerState = "Disabled" - // ServerStateDropping ... - ServerStateDropping ServerState = "Dropping" - // ServerStateReady ... - ServerStateReady ServerState = "Ready" -) - -// PossibleServerStateValues returns an array of possible values for the ServerState const type. -func PossibleServerStateValues() []ServerState { - return []ServerState{ServerStateDisabled, ServerStateDropping, ServerStateReady} -} - -// ServerVersion enumerates the values for server version. -type ServerVersion string - -const ( - // NineFullStopFive ... - NineFullStopFive ServerVersion = "9.5" - // NineFullStopSix ... - NineFullStopSix ServerVersion = "9.6" - // OneOne ... - OneOne ServerVersion = "11" - // OneZero ... - OneZero ServerVersion = "10" - // OneZeroFullStopTwo ... - OneZeroFullStopTwo ServerVersion = "10.2" - // OneZeroFullStopZero ... - OneZeroFullStopZero ServerVersion = "10.0" -) - -// PossibleServerVersionValues returns an array of possible values for the ServerVersion const type. -func PossibleServerVersionValues() []ServerVersion { - return []ServerVersion{NineFullStopFive, NineFullStopSix, OneOne, OneZero, OneZeroFullStopTwo, OneZeroFullStopZero} -} - -// SkuTier enumerates the values for sku tier. -type SkuTier string - -const ( - // Basic ... - Basic SkuTier = "Basic" - // GeneralPurpose ... - GeneralPurpose SkuTier = "GeneralPurpose" - // MemoryOptimized ... - MemoryOptimized SkuTier = "MemoryOptimized" -) - -// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. -func PossibleSkuTierValues() []SkuTier { - return []SkuTier{Basic, GeneralPurpose, MemoryOptimized} -} - -// SslEnforcementEnum enumerates the values for ssl enforcement enum. -type SslEnforcementEnum string - -const ( - // SslEnforcementEnumDisabled ... - SslEnforcementEnumDisabled SslEnforcementEnum = "Disabled" - // SslEnforcementEnumEnabled ... - SslEnforcementEnumEnabled SslEnforcementEnum = "Enabled" -) - -// PossibleSslEnforcementEnumValues returns an array of possible values for the SslEnforcementEnum const type. -func PossibleSslEnforcementEnumValues() []SslEnforcementEnum { - return []SslEnforcementEnum{SslEnforcementEnumDisabled, SslEnforcementEnumEnabled} -} - -// StorageAutogrow enumerates the values for storage autogrow. -type StorageAutogrow string - -const ( - // StorageAutogrowDisabled ... - StorageAutogrowDisabled StorageAutogrow = "Disabled" - // StorageAutogrowEnabled ... - StorageAutogrowEnabled StorageAutogrow = "Enabled" -) - -// PossibleStorageAutogrowValues returns an array of possible values for the StorageAutogrow const type. -func PossibleStorageAutogrowValues() []StorageAutogrow { - return []StorageAutogrow{StorageAutogrowDisabled, StorageAutogrowEnabled} -} - -// VirtualNetworkRuleState enumerates the values for virtual network rule state. -type VirtualNetworkRuleState string - -const ( - // Deleting ... - Deleting VirtualNetworkRuleState = "Deleting" - // Initializing ... - Initializing VirtualNetworkRuleState = "Initializing" - // InProgress ... - InProgress VirtualNetworkRuleState = "InProgress" - // Ready ... - Ready VirtualNetworkRuleState = "Ready" - // Unknown ... - Unknown VirtualNetworkRuleState = "Unknown" -) - -// PossibleVirtualNetworkRuleStateValues returns an array of possible values for the VirtualNetworkRuleState const type. -func PossibleVirtualNetworkRuleStateValues() []VirtualNetworkRuleState { - return []VirtualNetworkRuleState{Deleting, Initializing, InProgress, Ready, Unknown} -} - // CloudError an error response from the Batch service. type CloudError struct { Error *CloudErrorBody `json:"error,omitempty"` @@ -334,6 +145,18 @@ type ConfigurationProperties struct { Source *string `json:"source,omitempty"` } +// MarshalJSON is the custom marshaler for ConfigurationProperties. +func (cp ConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.Value != nil { + objectMap["value"] = cp.Value + } + if cp.Source != nil { + objectMap["source"] = cp.Source + } + return json.Marshal(objectMap) +} + // ConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ConfigurationsCreateOrUpdateFuture struct { @@ -480,8 +303,7 @@ 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 } @@ -591,8 +413,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 } @@ -736,6 +558,21 @@ type LogFileProperties struct { URL *string `json:"url,omitempty"` } +// MarshalJSON is the custom marshaler for LogFileProperties. +func (lfp LogFileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lfp.SizeInKB != nil { + objectMap["sizeInKB"] = lfp.SizeInKB + } + if lfp.Type != nil { + objectMap["type"] = lfp.Type + } + if lfp.URL != nil { + objectMap["url"] = lfp.URL + } + return json.Marshal(objectMap) +} + // NameAvailability represents a resource name availability. type NameAvailability struct { autorest.Response `json:"-"` @@ -827,6 +664,56 @@ type PerformanceTierServiceLevelObjectives struct { MinStorageMB *int32 `json:"minStorageMB,omitempty"` } +// PrivateEndpointConnectionProperties properties of a private endpoint connection. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - Private endpoint which the connection belongs to. + PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - Connection state of the private endpoint connection. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` + // ProvisioningState - READ-ONLY; State of the private endpoint connection. Possible values include: 'Approving', 'Ready', 'Dropping', 'Failed', 'Rejecting' + ProvisioningState PrivateEndpointProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. +func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecp.PrivateEndpoint != nil { + objectMap["privateEndpoint"] = pecp.PrivateEndpoint + } + if pecp.PrivateLinkServiceConnectionState != nil { + objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState + } + return json.Marshal(objectMap) +} + +// PrivateEndpointProperty ... +type PrivateEndpointProperty struct { + // ID - Resource id of the private endpoint. + ID *string `json:"id,omitempty"` +} + +// PrivateLinkServiceConnectionStateProperty ... +type PrivateLinkServiceConnectionStateProperty struct { + // Status - The private link service connection status. Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected' + Status PrivateLinkServiceConnectionStateStatus `json:"status,omitempty"` + // Description - The private link service connection description. + Description *string `json:"description,omitempty"` + // ActionsRequired - READ-ONLY; The actions required for private link service connection. Possible values include: 'None' + ActionsRequired PrivateLinkServiceConnectionStateActionsRequire `json:"actionsRequired,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty. +func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plscsp.Status != "" { + objectMap["status"] = plscsp.Status + } + if plscsp.Description != nil { + objectMap["description"] = plscsp.Description + } + return json.Marshal(objectMap) +} + // ProxyResource resource properties. type ProxyResource struct { // ID - READ-ONLY; Resource ID @@ -847,6 +734,15 @@ type ResourceIdentity struct { TenantID *uuid.UUID `json:"tenantId,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceIdentity. +func (ri ResourceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ri.Type != "" { + objectMap["type"] = ri.Type + } + return json.Marshal(objectMap) +} + // SecurityAlertPolicyProperties properties of a security alert policy. type SecurityAlertPolicyProperties struct { // State - Specifies the state of the policy, whether it is enabled or disabled. Possible values include: 'ServerSecurityAlertPolicyStateEnabled', 'ServerSecurityAlertPolicyStateDisabled' @@ -998,7 +894,7 @@ func (s *Server) UnmarshalJSON(body []byte) error { type ServerAdministratorProperties struct { // AdministratorType - The type of administrator. AdministratorType *string `json:"administratorType,omitempty"` - // Login - The server administrator login value. + // Login - The server administrator login account name. Login *string `json:"login,omitempty"` // Sid - The server administrator Sid (Secure ID). Sid *uuid.UUID `json:"sid,omitempty"` @@ -1115,15 +1011,15 @@ 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 } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *ServerAdministratorsDeleteFuture) Result(client ServerAdministratorsClient) (sar ServerAdministratorResource, err error) { +func (future *ServerAdministratorsDeleteFuture) Result(client ServerAdministratorsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -1134,13 +1030,7 @@ func (future *ServerAdministratorsDeleteFuture) Result(client ServerAdministrato err = azure.NewAsyncOpIncompleteError("postgresql.ServerAdministratorsDeleteFuture") return } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sar.Response.Response, err = future.GetResult(sender); err == nil && sar.Response.Response.StatusCode != http.StatusNoContent { - sar, err = client.DeleteResponder(sar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsDeleteFuture", "Result", sar.Response.Response, "Failure responding to request") - } - } + ar.Response = future.Response() return } @@ -1229,6 +1119,14 @@ type ServerListResult struct { Value *[]Server `json:"value,omitempty"` } +// ServerPrivateEndpointConnection a private endpoint connection under a server +type ServerPrivateEndpointConnection struct { + // ID - READ-ONLY; Resource Id of the private endpoint connection. + ID *string `json:"id,omitempty"` + // Properties - READ-ONLY; Private endpoint connection properties + Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` +} + // ServerProperties the properties of a server. type ServerProperties struct { // AdministratorLogin - The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). @@ -1237,7 +1135,13 @@ type ServerProperties struct { Version ServerVersion `json:"version,omitempty"` // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` - // UserVisibleState - A state of a server that is visible to user. Possible values include: 'ServerStateReady', 'ServerStateDropping', 'ServerStateDisabled' + // MinimalTLSVersion - Enforce a minimal Tls version for the server. Possible values include: 'TLS10', 'TLS11', 'TLS12', 'TLSEnforcementDisabled' + MinimalTLSVersion MinimalTLSVersionEnum `json:"minimalTlsVersion,omitempty"` + // ByokEnforcement - READ-ONLY; Status showing whether the server data encryption is enabled with customer-managed keys. + ByokEnforcement *string `json:"byokEnforcement,omitempty"` + // InfrastructureEncryption - Status showing whether the server enabled infrastructure encryption. Possible values include: 'InfrastructureEncryptionEnabled', 'InfrastructureEncryptionDisabled' + InfrastructureEncryption InfrastructureEncryption `json:"infrastructureEncryption,omitempty"` + // UserVisibleState - A state of a server that is visible to user. Possible values include: 'ServerStateReady', 'ServerStateDropping', 'ServerStateDisabled', 'ServerStateInaccessible' UserVisibleState ServerState `json:"userVisibleState,omitempty"` // FullyQualifiedDomainName - The fully qualified domain name of a server. FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"` @@ -1251,6 +1155,55 @@ type ServerProperties struct { MasterServerID *string `json:"masterServerId,omitempty"` // ReplicaCapacity - The maximum number of replicas that a master server can have. ReplicaCapacity *int32 `json:"replicaCapacity,omitempty"` + // PublicNetworkAccess - Whether or not public endpoint access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' + PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` + // PrivateEndpointConnections - READ-ONLY; List of private endpoint connections on a server + PrivateEndpointConnections *[]ServerPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerProperties. +func (sp ServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.AdministratorLogin != nil { + objectMap["administratorLogin"] = sp.AdministratorLogin + } + if sp.Version != "" { + objectMap["version"] = sp.Version + } + if sp.SslEnforcement != "" { + objectMap["sslEnforcement"] = sp.SslEnforcement + } + if sp.MinimalTLSVersion != "" { + objectMap["minimalTlsVersion"] = sp.MinimalTLSVersion + } + if sp.InfrastructureEncryption != "" { + objectMap["infrastructureEncryption"] = sp.InfrastructureEncryption + } + if sp.UserVisibleState != "" { + objectMap["userVisibleState"] = sp.UserVisibleState + } + if sp.FullyQualifiedDomainName != nil { + objectMap["fullyQualifiedDomainName"] = sp.FullyQualifiedDomainName + } + if sp.EarliestRestoreDate != nil { + objectMap["earliestRestoreDate"] = sp.EarliestRestoreDate + } + if sp.StorageProfile != nil { + objectMap["storageProfile"] = sp.StorageProfile + } + if sp.ReplicationRole != nil { + objectMap["replicationRole"] = sp.ReplicationRole + } + if sp.MasterServerID != nil { + objectMap["masterServerId"] = sp.MasterServerID + } + if sp.ReplicaCapacity != nil { + objectMap["replicaCapacity"] = sp.ReplicaCapacity + } + if sp.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = sp.PublicNetworkAccess + } + return json.Marshal(objectMap) } // BasicServerPropertiesForCreate the properties used to create a new server. @@ -1268,6 +1221,8 @@ type ServerPropertiesForCreate struct { Version ServerVersion `json:"version,omitempty"` // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` + // MinimalTLSVersion - Enforce a minimal Tls version for the server. Possible values include: 'TLS10', 'TLS11', 'TLS12', 'TLSEnforcementDisabled' + MinimalTLSVersion MinimalTLSVersionEnum `json:"minimalTlsVersion,omitempty"` // StorageProfile - Storage profile of a server. StorageProfile *StorageProfile `json:"storageProfile,omitempty"` // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' @@ -1333,6 +1288,9 @@ func (spfc ServerPropertiesForCreate) MarshalJSON() ([]byte, error) { if spfc.SslEnforcement != "" { objectMap["sslEnforcement"] = spfc.SslEnforcement } + if spfc.MinimalTLSVersion != "" { + objectMap["minimalTlsVersion"] = spfc.MinimalTLSVersion + } if spfc.StorageProfile != nil { objectMap["storageProfile"] = spfc.StorageProfile } @@ -1382,6 +1340,8 @@ type ServerPropertiesForDefaultCreate struct { Version ServerVersion `json:"version,omitempty"` // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` + // MinimalTLSVersion - Enforce a minimal Tls version for the server. Possible values include: 'TLS10', 'TLS11', 'TLS12', 'TLSEnforcementDisabled' + MinimalTLSVersion MinimalTLSVersionEnum `json:"minimalTlsVersion,omitempty"` // StorageProfile - Storage profile of a server. StorageProfile *StorageProfile `json:"storageProfile,omitempty"` // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' @@ -1404,6 +1364,9 @@ func (spfdc ServerPropertiesForDefaultCreate) MarshalJSON() ([]byte, error) { if spfdc.SslEnforcement != "" { objectMap["sslEnforcement"] = spfdc.SslEnforcement } + if spfdc.MinimalTLSVersion != "" { + objectMap["minimalTlsVersion"] = spfdc.MinimalTLSVersion + } if spfdc.StorageProfile != nil { objectMap["storageProfile"] = spfdc.StorageProfile } @@ -1443,8 +1406,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"` @@ -1452,6 +1415,8 @@ type ServerPropertiesForGeoRestore struct { Version ServerVersion `json:"version,omitempty"` // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` + // MinimalTLSVersion - Enforce a minimal Tls version for the server. Possible values include: 'TLS10', 'TLS11', 'TLS12', 'TLSEnforcementDisabled' + MinimalTLSVersion MinimalTLSVersionEnum `json:"minimalTlsVersion,omitempty"` // StorageProfile - Storage profile of a server. StorageProfile *StorageProfile `json:"storageProfile,omitempty"` // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' @@ -1471,6 +1436,9 @@ func (spfgr ServerPropertiesForGeoRestore) MarshalJSON() ([]byte, error) { if spfgr.SslEnforcement != "" { objectMap["sslEnforcement"] = spfgr.SslEnforcement } + if spfgr.MinimalTLSVersion != "" { + objectMap["minimalTlsVersion"] = spfgr.MinimalTLSVersion + } if spfgr.StorageProfile != nil { objectMap["storageProfile"] = spfgr.StorageProfile } @@ -1518,6 +1486,8 @@ type ServerPropertiesForReplica struct { Version ServerVersion `json:"version,omitempty"` // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` + // MinimalTLSVersion - Enforce a minimal Tls version for the server. Possible values include: 'TLS10', 'TLS11', 'TLS12', 'TLSEnforcementDisabled' + MinimalTLSVersion MinimalTLSVersionEnum `json:"minimalTlsVersion,omitempty"` // StorageProfile - Storage profile of a server. StorageProfile *StorageProfile `json:"storageProfile,omitempty"` // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' @@ -1537,6 +1507,9 @@ func (spfr ServerPropertiesForReplica) MarshalJSON() ([]byte, error) { if spfr.SslEnforcement != "" { objectMap["sslEnforcement"] = spfr.SslEnforcement } + if spfr.MinimalTLSVersion != "" { + objectMap["minimalTlsVersion"] = spfr.MinimalTLSVersion + } if spfr.StorageProfile != nil { objectMap["storageProfile"] = spfr.StorageProfile } @@ -1586,6 +1559,8 @@ type ServerPropertiesForRestore struct { Version ServerVersion `json:"version,omitempty"` // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` + // MinimalTLSVersion - Enforce a minimal Tls version for the server. Possible values include: 'TLS10', 'TLS11', 'TLS12', 'TLSEnforcementDisabled' + MinimalTLSVersion MinimalTLSVersionEnum `json:"minimalTlsVersion,omitempty"` // StorageProfile - Storage profile of a server. StorageProfile *StorageProfile `json:"storageProfile,omitempty"` // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' @@ -1608,6 +1583,9 @@ func (spfr ServerPropertiesForRestore) MarshalJSON() ([]byte, error) { if spfr.SslEnforcement != "" { objectMap["sslEnforcement"] = spfr.SslEnforcement } + if spfr.MinimalTLSVersion != "" { + objectMap["minimalTlsVersion"] = spfr.MinimalTLSVersion + } if spfr.StorageProfile != nil { objectMap["storageProfile"] = spfr.StorageProfile } @@ -1647,8 +1625,7 @@ 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 } @@ -1676,8 +1653,7 @@ 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 } @@ -1699,8 +1675,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 } @@ -1801,8 +1777,7 @@ 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 } @@ -1824,8 +1799,7 @@ 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 } @@ -1930,6 +1904,8 @@ type ServerUpdateParametersProperties struct { Version ServerVersion `json:"version,omitempty"` // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` + // MinimalTLSVersion - Enforce a minimal Tls version for the server. Possible values include: 'TLS10', 'TLS11', 'TLS12', 'TLSEnforcementDisabled' + MinimalTLSVersion MinimalTLSVersionEnum `json:"minimalTlsVersion,omitempty"` // ReplicationRole - The replication role of the server. ReplicationRole *string `json:"replicationRole,omitempty"` } @@ -2136,10 +2112,15 @@ func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool { return vnrlr.Value == nil || len(*vnrlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vnrlr VirtualNetworkRuleListResult) hasNextLink() bool { + return vnrlr.NextLink != nil && len(*vnrlr.NextLink) != 0 +} + // virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if vnrlr.NextLink == nil || len(to.String(vnrlr.NextLink)) < 1 { + if !vnrlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2167,11 +2148,16 @@ func (page *VirtualNetworkRuleListResultPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vnrlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vnrlr) + if err != nil { + return err + } + page.vnrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vnrlr = next return nil } @@ -2211,10 +2197,22 @@ type VirtualNetworkRuleProperties struct { VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` // IgnoreMissingVnetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled. IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"` - // State - READ-ONLY; Virtual Network Rule State. Possible values include: 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown' + // State - READ-ONLY; Virtual Network Rule State. Possible values include: 'VirtualNetworkRuleStateInitializing', 'VirtualNetworkRuleStateInProgress', 'VirtualNetworkRuleStateReady', 'VirtualNetworkRuleStateDeleting', 'VirtualNetworkRuleStateUnknown' State VirtualNetworkRuleState `json:"state,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkRuleProperties. +func (vnrp VirtualNetworkRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnrp.VirtualNetworkSubnetID != nil { + objectMap["virtualNetworkSubnetId"] = vnrp.VirtualNetworkSubnetID + } + if vnrp.IgnoreMissingVnetServiceEndpoint != nil { + objectMap["ignoreMissingVnetServiceEndpoint"] = vnrp.IgnoreMissingVnetServiceEndpoint + } + return json.Marshal(objectMap) +} + // VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkRulesCreateOrUpdateFuture struct { @@ -2244,8 +2242,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/preview/postgresql/mgmt/2017-12-01-preview/postgresql/operations.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/operations.go index 80fd1ddf4621..c1d7eac3222d 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/operations.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/operations.go @@ -102,7 +102,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/postgresqlapi/interfaces.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/postgresqlapi/interfaces.go index e84595961f90..6033eba5f2ab 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/postgresqlapi/interfaces.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/postgresqlapi/interfaces.go @@ -94,7 +94,7 @@ type ServerAdministratorsClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, properties postgresql.ServerAdministratorResource) (result postgresql.ServerAdministratorsCreateOrUpdateFuture, err error) Delete(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.ServerAdministratorsDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.ServerAdministratorResource, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.ServerAdministratorResourceListResult, err error) + List(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.ServerAdministratorResourceListResult, err error) } var _ ServerAdministratorsClientAPI = (*postgresql.ServerAdministratorsClient)(nil) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/replicas.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/replicas.go index 67997e3c94a9..42700891e58f 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/replicas.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/replicas.go @@ -112,7 +112,6 @@ func (client ReplicasClient) ListByServerSender(req *http.Request) (*http.Respon func (client ReplicasClient) ListByServerResponder(resp *http.Response) (result ServerListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serveradministrators.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serveradministrators.go index d1bb901b7527..d76ebcf93f6e 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serveradministrators.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serveradministrators.go @@ -129,7 +129,6 @@ func (client ServerAdministratorsClient) CreateOrUpdateSender(req *http.Request) func (client ServerAdministratorsClient) CreateOrUpdateResponder(resp *http.Response) (result ServerAdministratorResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -203,14 +202,12 @@ func (client ServerAdministratorsClient) DeleteSender(req *http.Request) (future // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client ServerAdministratorsClient) DeleteResponder(resp *http.Response) (result ServerAdministratorResource, err error) { +func (client ServerAdministratorsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } @@ -283,7 +280,6 @@ func (client ServerAdministratorsClient) GetSender(req *http.Request) (*http.Res func (client ServerAdministratorsClient) GetResponder(resp *http.Response) (result ServerAdministratorResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -291,14 +287,14 @@ func (client ServerAdministratorsClient) GetResponder(resp *http.Response) (resu return } -// ListByServer returns a list of server Administrators. +// List returns a list of server Administrators. // 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 ServerAdministratorsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerAdministratorResourceListResult, err error) { +func (client ServerAdministratorsClient) List(ctx context.Context, resourceGroupName string, serverName string) (result ServerAdministratorResourceListResult, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdministratorsClient.ListByServer") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdministratorsClient.List") defer func() { sc := -1 if result.Response.Response != nil { @@ -307,29 +303,29 @@ func (client ServerAdministratorsClient) ListByServer(ctx context.Context, resou tracing.EndSpan(ctx, sc, err) }() } - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) + req, err := client.ListPreparer(ctx, resourceGroupName, serverName) if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "ListByServer", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "List", nil, "Failure preparing request") return } - resp, err := client.ListByServerSender(req) + resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "ListByServer", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "List", resp, "Failure sending request") return } - result, err = client.ListByServerResponder(resp) + result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "ListByServer", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "List", resp, "Failure responding to request") } return } -// ListByServerPreparer prepares the ListByServer request. -func (client ServerAdministratorsClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { +// ListPreparer prepares the List request. +func (client ServerAdministratorsClient) 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), @@ -349,18 +345,17 @@ func (client ServerAdministratorsClient) ListByServerPreparer(ctx context.Contex return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListByServerSender sends the ListByServer request. The method will close the +// ListSender sends the List request. The method will close the // http.Response Body if it receives an error. -func (client ServerAdministratorsClient) ListByServerSender(req *http.Request) (*http.Response, error) { +func (client ServerAdministratorsClient) ListSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// ListByServerResponder handles the response to the ListByServer request. The method always +// ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client ServerAdministratorsClient) ListByServerResponder(resp *http.Response) (result ServerAdministratorResourceListResult, err error) { +func (client ServerAdministratorsClient) ListResponder(resp *http.Response) (result ServerAdministratorResourceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/servers.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/servers.go index 121c799fe939..49965d793307 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/servers.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/servers.go @@ -127,7 +127,6 @@ func (client ServersClient) CreateSender(req *http.Request) (future ServersCreat func (client ServersClient) CreateResponder(resp *http.Response) (result Server, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -204,7 +203,6 @@ func (client ServersClient) DeleteSender(req *http.Request) (future ServersDelet func (client ServersClient) 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 @@ -280,7 +278,6 @@ func (client ServersClient) GetSender(req *http.Request) (*http.Response, error) func (client ServersClient) GetResponder(resp *http.Response) (result Server, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -351,7 +348,6 @@ func (client ServersClient) ListSender(req *http.Request) (*http.Response, error func (client ServersClient) ListResponder(resp *http.Response) (result ServerListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -426,7 +422,6 @@ func (client ServersClient) ListByResourceGroupSender(req *http.Request) (*http. func (client ServersClient) ListByResourceGroupResponder(resp *http.Response) (result ServerListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -503,7 +498,6 @@ func (client ServersClient) RestartSender(req *http.Request) (future ServersRest func (client ServersClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -583,7 +577,6 @@ func (client ServersClient) UpdateSender(req *http.Request) (future ServersUpdat func (client ServersClient) UpdateResponder(resp *http.Response) (result Server, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serversecurityalertpolicies.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serversecurityalertpolicies.go index bdb2ddf9c8d0..faaf2e70ee5d 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serversecurityalertpolicies.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serversecurityalertpolicies.go @@ -117,7 +117,6 @@ func (client ServerSecurityAlertPoliciesClient) CreateOrUpdateSender(req *http.R func (client ServerSecurityAlertPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServerSecurityAlertPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -195,7 +194,6 @@ func (client ServerSecurityAlertPoliciesClient) GetSender(req *http.Request) (*h func (client ServerSecurityAlertPoliciesClient) GetResponder(resp *http.Response) (result ServerSecurityAlertPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/version.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/version.go index b1668874f92b..5ef54fdca1d4 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/version.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " postgresql/2017-12-01-preview" + return "Azure-SDK-For-Go/" + Version() + " postgresql/2017-12-01-preview" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/virtualnetworkrules.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/virtualnetworkrules.go index 30754b297c32..20d3fa818cd6 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/virtualnetworkrules.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/virtualnetworkrules.go @@ -126,7 +126,6 @@ func (client VirtualNetworkRulesClient) CreateOrUpdateSender(req *http.Request) func (client VirtualNetworkRulesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -205,7 +204,6 @@ func (client VirtualNetworkRulesClient) DeleteSender(req *http.Request) (future func (client VirtualNetworkRulesClient) 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 @@ -283,7 +281,6 @@ func (client VirtualNetworkRulesClient) GetSender(req *http.Request) (*http.Resp func (client VirtualNetworkRulesClient) GetResponder(resp *http.Response) (result VirtualNetworkRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -325,6 +322,9 @@ func (client VirtualNetworkRulesClient) ListByServer(ctx context.Context, resour if err != nil { err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "ListByServer", resp, "Failure responding to request") } + if result.vnrlr.hasNextLink() && result.vnrlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -361,7 +361,6 @@ func (client VirtualNetworkRulesClient) ListByServerSender(req *http.Request) (* func (client VirtualNetworkRulesClient) ListByServerResponder(resp *http.Response) (result VirtualNetworkRuleListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing())