Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,17 @@ internal CheckNameAvailabilityOperations(PostgreSQLManagementClient client)
/// </return>
public async Task<AzureOperationResponse<NameAvailability>> ExecuteWithHttpMessagesAsync(NameAvailabilityRequest nameAvailabilityRequest, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
if (Client.SubscriptionId != null)
{
if (Client.SubscriptionId.Length < 1)
{
throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (nameAvailabilityRequest == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "nameAvailabilityRequest");
Expand All @@ -95,13 +98,15 @@ internal CheckNameAvailabilityOperations(PostgreSQLManagementClient client)
{
nameAvailabilityRequest.Validate();
}
string apiVersion = "2017-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("nameAvailabilityRequest", nameAvailabilityRequest);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Execute", tracingParameters);
Expand All @@ -111,9 +116,9 @@ internal CheckNameAvailabilityOperations(PostgreSQLManagementClient client)
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/checkNameAvailability").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List<string> _queryParameters = new List<string>();
if (Client.ApiVersion != null)
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
if (_queryParameters.Count > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ internal ConfigurationsOperations(PostgreSQLManagementClient client)
/// Updates a configuration of a server.
/// </summary>
/// <param name='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.
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='serverName'>
/// The name of the server.
Expand Down Expand Up @@ -83,8 +82,7 @@ internal ConfigurationsOperations(PostgreSQLManagementClient client)
/// Gets information about a configuration of server.
/// </summary>
/// <param name='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.
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='serverName'>
/// The name of the server.
Expand Down Expand Up @@ -115,18 +113,36 @@ internal ConfigurationsOperations(PostgreSQLManagementClient client)
/// </return>
public async Task<AzureOperationResponse<Configuration>> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string configurationName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
if (Client.SubscriptionId != null)
{
if (Client.SubscriptionId.Length < 1)
{
throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
{
throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
}
}
if (serverName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
Expand All @@ -135,13 +151,15 @@ internal ConfigurationsOperations(PostgreSQLManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "configurationName");
}
string apiVersion = "2017-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("configurationName", configurationName);
Expand All @@ -156,9 +174,9 @@ internal ConfigurationsOperations(PostgreSQLManagementClient client)
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
_url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName));
List<string> _queryParameters = new List<string>();
if (Client.ApiVersion != null)
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
if (_queryParameters.Count > 0)
{
Expand Down Expand Up @@ -289,8 +307,7 @@ internal ConfigurationsOperations(PostgreSQLManagementClient client)
/// List all the configurations in a given server.
/// </summary>
/// <param name='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.
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='serverName'>
/// The name of the server.
Expand Down Expand Up @@ -318,29 +335,49 @@ internal ConfigurationsOperations(PostgreSQLManagementClient client)
/// </return>
public async Task<AzureOperationResponse<IEnumerable<Configuration>>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
if (Client.SubscriptionId != null)
{
if (Client.SubscriptionId.Length < 1)
{
throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
{
throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
}
}
if (serverName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
}
string apiVersion = "2017-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("cancellationToken", cancellationToken);
Expand All @@ -353,9 +390,9 @@ internal ConfigurationsOperations(PostgreSQLManagementClient client)
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
List<string> _queryParameters = new List<string>();
if (Client.ApiVersion != null)
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
if (_queryParameters.Count > 0)
{
Expand Down Expand Up @@ -486,8 +523,7 @@ internal ConfigurationsOperations(PostgreSQLManagementClient client)
/// Updates a configuration of a server.
/// </summary>
/// <param name='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.
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='serverName'>
/// The name of the server.
Expand Down Expand Up @@ -521,18 +557,36 @@ internal ConfigurationsOperations(PostgreSQLManagementClient client)
/// </return>
public async Task<AzureOperationResponse<Configuration>> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string configurationName, Configuration parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
if (Client.SubscriptionId != null)
{
if (Client.SubscriptionId.Length < 1)
{
throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
{
throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
}
}
if (serverName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
Expand All @@ -545,13 +599,15 @@ internal ConfigurationsOperations(PostgreSQLManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
}
string apiVersion = "2017-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("configurationName", configurationName);
Expand All @@ -567,9 +623,9 @@ internal ConfigurationsOperations(PostgreSQLManagementClient client)
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
_url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName));
List<string> _queryParameters = new List<string>();
if (Client.ApiVersion != null)
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
if (_queryParameters.Count > 0)
{
Expand Down
Loading