diff --git a/eng/mgmt/mgmtmetadata/apimanagement_resource-manager.txt b/eng/mgmt/mgmtmetadata/apimanagement_resource-manager.txt
index 789e33cddcc1c..583e3d4476c67 100644
--- a/eng/mgmt/mgmtmetadata/apimanagement_resource-manager.txt
+++ b/eng/mgmt/mgmtmetadata/apimanagement_resource-manager.txt
@@ -1,11 +1,14 @@
-2020-02-11 05:53:16 UTC
-
-1) azure-rest-api-specs repository information
-GitHub user: Azure
+Installing AutoRest version: v2
+AutoRest installed successfully.
+Commencing code generation
+Generating CSharp code
+Executing AutoRest command
+cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/apimanagement/resource-manager/readme.md --csharp --version="2.0.4417" --reflect-api-versions --tag=package-2020-12 --csharp-sdks-folder=C:\azure-sdk-for-net\sdk
+2021-05-21 07:03:54 UTC
+Azure-rest-api-specs repository information
+GitHub fork: Azure
Branch: master
-Commit: 26bdb0c40d9403e07980e41f054ec75f72225d52
-
-2) AutoRest information
-Requested version: latest
-Bootstrapper version: C:\Users\sasolank\AppData\Roaming\npm `-- autorest@2.0.4413
-Latest installed version:
+Commit: 5047dfdf585969892ac035ffdfbc57623f0bf1c5
+AutoRest information
+Requested version: v2
+Bootstrapper version: autorest@2.0.4417
\ No newline at end of file
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/AzSdk.RP.props b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/AzSdk.RP.props
index e815af3ce6359..8f960ce3b37a6 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/AzSdk.RP.props
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/AzSdk.RP.props
@@ -1,7 +1,7 @@
- ApiManagement_2019-12-01;
+ ApiManagement_2020-12-01;
$(PackageTags);$(CommonTags);$(AzureApiTag);
\ No newline at end of file
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/CHANGELOG.md b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/CHANGELOG.md
index 4f5431669115e..c938037f3b781 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/CHANGELOG.md
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/CHANGELOG.md
@@ -1,8 +1,11 @@
## Microsoft.Azure.Management.ApiManagment release notes
-### Changes in 6.0.0-preview
+### Changes in 7.0.0-preview
-- Fixed `quotas` update contract
+- Switch the .NET client to use api-version `2020-12-01`
+- new entities added, are `ContentType`, `ContentItem`, `DeletedServices`, `GatewayCertificateAuthority`, `PortalRevision`, `PortalSettings`, `TenantSettings`, `ApiManagementSkus`.
+- Added support for creating Azure KeyVault based `namedValues`, which allows auto rotation of this Entity. blocked POST operations to get entity secret from it due to Security Issue.
+- Added support for creating Azure KeyVault based `certificates`, which allows auto rotation of this Entity.
### Changes in 5.0.0-preview
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiDiagnosticOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiDiagnosticOperations.cs
index adb2243e4b0f2..065af6278a09a 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiDiagnosticOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiDiagnosticOperations.cs
@@ -128,11 +128,14 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.MinLength, "apiId", 1);
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -144,7 +147,6 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByService", tracingParameters);
}
@@ -164,9 +166,9 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
_queryParameters.Add(_odataFilter);
}
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -383,11 +385,14 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "diagnosticId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -399,7 +404,6 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("diagnosticId", diagnosticId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters);
}
@@ -412,9 +416,9 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
_url = _url.Replace("{diagnosticId}", System.Uri.EscapeDataString(diagnosticId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -628,11 +632,14 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "diagnosticId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -644,7 +651,6 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("diagnosticId", diagnosticId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -657,9 +663,9 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
_url = _url.Replace("{diagnosticId}", System.Uri.EscapeDataString(diagnosticId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -906,11 +912,14 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -924,7 +933,6 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
tracingParameters.Add("diagnosticId", diagnosticId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
@@ -937,9 +945,9 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
_url = _url.Replace("{diagnosticId}", System.Uri.EscapeDataString(diagnosticId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1141,6 +1149,9 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
@@ -1150,7 +1161,7 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string diagnosticId, DiagnosticContract parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string diagnosticId, DiagnosticContract parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -1217,11 +1228,14 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1235,7 +1249,6 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
tracingParameters.Add("diagnosticId", diagnosticId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
}
@@ -1248,9 +1261,9 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
_url = _url.Replace("{diagnosticId}", System.Uri.EscapeDataString(diagnosticId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1324,7 +1337,7 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 204)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1354,13 +1367,44 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -1471,11 +1515,14 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1488,7 +1535,6 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("diagnosticId", diagnosticId);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
@@ -1501,9 +1547,9 @@ internal ApiDiagnosticOperations(ApiManagementClient client)
_url = _url.Replace("{diagnosticId}", System.Uri.EscapeDataString(diagnosticId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiDiagnosticOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiDiagnosticOperationsExtensions.cs
index 14d1c79f6ff91..7d8ff6ad9cb6b 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiDiagnosticOperationsExtensions.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiDiagnosticOperationsExtensions.cs
@@ -289,9 +289,9 @@ public static DiagnosticContract Get(this IApiDiagnosticOperations operations, s
/// header response of the GET request or it should be * for unconditional
/// update.
///
- public static void Update(this IApiDiagnosticOperations operations, string resourceGroupName, string serviceName, string apiId, string diagnosticId, DiagnosticContract parameters, string ifMatch)
+ public static DiagnosticContract Update(this IApiDiagnosticOperations operations, string resourceGroupName, string serviceName, string apiId, string diagnosticId, DiagnosticContract parameters, string ifMatch)
{
- operations.UpdateAsync(resourceGroupName, serviceName, apiId, diagnosticId, parameters, ifMatch).GetAwaiter().GetResult();
+ return operations.UpdateAsync(resourceGroupName, serviceName, apiId, diagnosticId, parameters, ifMatch).GetAwaiter().GetResult();
}
///
@@ -326,9 +326,12 @@ public static void Update(this IApiDiagnosticOperations operations, string resou
///
/// The cancellation token.
///
- public static async Task UpdateAsync(this IApiDiagnosticOperations operations, string resourceGroupName, string serviceName, string apiId, string diagnosticId, DiagnosticContract parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateAsync(this IApiDiagnosticOperations operations, string resourceGroupName, string serviceName, string apiId, string diagnosticId, DiagnosticContract parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, diagnosticId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, diagnosticId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiExportOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiExportOperations.cs
index 60d0322d2ae8f..2d7f92833e359 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiExportOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiExportOperations.cs
@@ -139,12 +139,15 @@ internal ApiExportOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "format");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string export = "true";
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -157,7 +160,6 @@ internal ApiExportOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("format", format);
tracingParameters.Add("export", export);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -177,9 +179,9 @@ internal ApiExportOperations(ApiManagementClient client)
{
_queryParameters.Add(string.Format("export={0}", System.Uri.EscapeDataString(export)));
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueAttachmentOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueAttachmentOperations.cs
index 7d2e18fafa590..9091d14c3a0cd 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueAttachmentOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueAttachmentOperations.cs
@@ -151,11 +151,14 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "issueId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -168,7 +171,6 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("issueId", issueId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByService", tracingParameters);
}
@@ -189,9 +191,9 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
_queryParameters.Add(_odataFilter);
}
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -430,11 +432,14 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "attachmentId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -447,7 +452,6 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("issueId", issueId);
tracingParameters.Add("attachmentId", attachmentId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters);
}
@@ -461,9 +465,9 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
_url = _url.Replace("{attachmentId}", System.Uri.EscapeDataString(attachmentId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -700,11 +704,14 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "attachmentId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -717,7 +724,6 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("issueId", issueId);
tracingParameters.Add("attachmentId", attachmentId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -731,9 +737,9 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
_url = _url.Replace("{attachmentId}", System.Uri.EscapeDataString(attachmentId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1003,11 +1009,14 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1022,7 +1031,6 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
tracingParameters.Add("attachmentId", attachmentId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
@@ -1036,9 +1044,9 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
_url = _url.Replace("{attachmentId}", System.Uri.EscapeDataString(attachmentId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1330,11 +1338,14 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1348,7 +1359,6 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
tracingParameters.Add("issueId", issueId);
tracingParameters.Add("attachmentId", attachmentId);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
@@ -1362,9 +1372,9 @@ internal ApiIssueAttachmentOperations(ApiManagementClient client)
_url = _url.Replace("{attachmentId}", System.Uri.EscapeDataString(attachmentId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueCommentOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueCommentOperations.cs
index 2c91c0557ebcf..a8088f010398f 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueCommentOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueCommentOperations.cs
@@ -151,11 +151,14 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "issueId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -168,7 +171,6 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("issueId", issueId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByService", tracingParameters);
}
@@ -189,9 +191,9 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
_queryParameters.Add(_odataFilter);
}
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -430,11 +432,14 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "commentId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -447,7 +452,6 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("issueId", issueId);
tracingParameters.Add("commentId", commentId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters);
}
@@ -461,9 +465,9 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
_url = _url.Replace("{commentId}", System.Uri.EscapeDataString(commentId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -700,11 +704,14 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "commentId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -717,7 +724,6 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("issueId", issueId);
tracingParameters.Add("commentId", commentId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -731,9 +737,9 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
_url = _url.Replace("{commentId}", System.Uri.EscapeDataString(commentId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1002,11 +1008,14 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1021,7 +1030,6 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
tracingParameters.Add("commentId", commentId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
@@ -1035,9 +1043,9 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
_url = _url.Replace("{commentId}", System.Uri.EscapeDataString(commentId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1329,11 +1337,14 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1347,7 +1358,6 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
tracingParameters.Add("issueId", issueId);
tracingParameters.Add("commentId", commentId);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
@@ -1361,9 +1371,9 @@ internal ApiIssueCommentOperations(ApiManagementClient client)
_url = _url.Replace("{commentId}", System.Uri.EscapeDataString(commentId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueOperations.cs
index 8dfc033201d24..db47719997c1d 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueOperations.cs
@@ -131,11 +131,14 @@ internal ApiIssueOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.MinLength, "apiId", 1);
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -148,7 +151,6 @@ internal ApiIssueOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("expandCommentsAttachments", expandCommentsAttachments);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByService", tracingParameters);
}
@@ -172,9 +174,9 @@ internal ApiIssueOperations(ApiManagementClient client)
{
_queryParameters.Add(string.Format("expandCommentsAttachments={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expandCommentsAttachments, Client.SerializationSettings).Trim('"'))));
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -391,11 +393,14 @@ internal ApiIssueOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "issueId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -407,7 +412,6 @@ internal ApiIssueOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("issueId", issueId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters);
}
@@ -420,9 +424,9 @@ internal ApiIssueOperations(ApiManagementClient client)
_url = _url.Replace("{issueId}", System.Uri.EscapeDataString(issueId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -639,11 +643,14 @@ internal ApiIssueOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "issueId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -656,7 +663,6 @@ internal ApiIssueOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("issueId", issueId);
tracingParameters.Add("expandCommentsAttachments", expandCommentsAttachments);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -673,9 +679,9 @@ internal ApiIssueOperations(ApiManagementClient client)
{
_queryParameters.Add(string.Format("expandCommentsAttachments={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expandCommentsAttachments, Client.SerializationSettings).Trim('"'))));
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -922,11 +928,14 @@ internal ApiIssueOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -940,7 +949,6 @@ internal ApiIssueOperations(ApiManagementClient client)
tracingParameters.Add("issueId", issueId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
@@ -953,9 +961,9 @@ internal ApiIssueOperations(ApiManagementClient client)
_url = _url.Replace("{issueId}", System.Uri.EscapeDataString(issueId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1156,6 +1164,9 @@ internal ApiIssueOperations(ApiManagementClient client)
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
@@ -1165,7 +1176,7 @@ internal ApiIssueOperations(ApiManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string issueId, IssueUpdateContract parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string issueId, IssueUpdateContract parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -1232,11 +1243,14 @@ internal ApiIssueOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1250,7 +1264,6 @@ internal ApiIssueOperations(ApiManagementClient client)
tracingParameters.Add("issueId", issueId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
}
@@ -1263,9 +1276,9 @@ internal ApiIssueOperations(ApiManagementClient client)
_url = _url.Replace("{issueId}", System.Uri.EscapeDataString(issueId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1339,7 +1352,7 @@ internal ApiIssueOperations(ApiManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 204)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1369,13 +1382,44 @@ internal ApiIssueOperations(ApiManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -1486,11 +1530,14 @@ internal ApiIssueOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1503,7 +1550,6 @@ internal ApiIssueOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("issueId", issueId);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
@@ -1516,9 +1562,9 @@ internal ApiIssueOperations(ApiManagementClient client)
_url = _url.Replace("{issueId}", System.Uri.EscapeDataString(issueId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueOperationsExtensions.cs
index 5dea01ca09f2b..28f62034c4e32 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueOperationsExtensions.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiIssueOperationsExtensions.cs
@@ -300,9 +300,9 @@ public static ApiIssueGetEntityTagHeaders GetEntityTag(this IApiIssueOperations
/// header response of the GET request or it should be * for unconditional
/// update.
///
- public static void Update(this IApiIssueOperations operations, string resourceGroupName, string serviceName, string apiId, string issueId, IssueUpdateContract parameters, string ifMatch)
+ public static IssueContract Update(this IApiIssueOperations operations, string resourceGroupName, string serviceName, string apiId, string issueId, IssueUpdateContract parameters, string ifMatch)
{
- operations.UpdateAsync(resourceGroupName, serviceName, apiId, issueId, parameters, ifMatch).GetAwaiter().GetResult();
+ return operations.UpdateAsync(resourceGroupName, serviceName, apiId, issueId, parameters, ifMatch).GetAwaiter().GetResult();
}
///
@@ -336,9 +336,12 @@ public static void Update(this IApiIssueOperations operations, string resourceGr
///
/// The cancellation token.
///
- public static async Task UpdateAsync(this IApiIssueOperations operations, string resourceGroupName, string serviceName, string apiId, string issueId, IssueUpdateContract parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateAsync(this IApiIssueOperations operations, string resourceGroupName, string serviceName, string apiId, string issueId, IssueUpdateContract parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, issueId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, issueId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementClient.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementClient.cs
index c1305552bcb20..b8a22a0c536b7 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementClient.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementClient.cs
@@ -151,11 +151,6 @@ public partial class ApiManagementClient : ServiceClient, I
///
public virtual IOperationOperations Operation { get; private set; }
- ///
- /// Gets the IApiExportOperations.
- ///
- public virtual IApiExportOperations ApiExport { get; private set; }
-
///
/// Gets the IApiVersionSetOperations.
///
@@ -181,6 +176,21 @@ public partial class ApiManagementClient : ServiceClient, I
///
public virtual ICertificateOperations Certificate { get; private set; }
+ ///
+ /// Gets the IContentTypeOperations.
+ ///
+ public virtual IContentTypeOperations ContentType { get; private set; }
+
+ ///
+ /// Gets the IContentItemOperations.
+ ///
+ public virtual IContentItemOperations ContentItem { get; private set; }
+
+ ///
+ /// Gets the IDeletedServicesOperations.
+ ///
+ public virtual IDeletedServicesOperations DeletedServices { get; private set; }
+
///
/// Gets the IApiManagementOperations.
///
@@ -221,6 +231,11 @@ public partial class ApiManagementClient : ServiceClient, I
///
public virtual IGatewayApiOperations GatewayApi { get; private set; }
+ ///
+ /// Gets the IGatewayCertificateAuthorityOperations.
+ ///
+ public virtual IGatewayCertificateAuthorityOperations GatewayCertificateAuthority { get; private set; }
+
///
/// Gets the IGroupOperations.
///
@@ -286,6 +301,16 @@ public partial class ApiManagementClient : ServiceClient, I
///
public virtual IPolicyDescriptionOperations PolicyDescription { get; private set; }
+ ///
+ /// Gets the IPortalRevisionOperations.
+ ///
+ public virtual IPortalRevisionOperations PortalRevision { get; private set; }
+
+ ///
+ /// Gets the IPortalSettingsOperations.
+ ///
+ public virtual IPortalSettingsOperations PortalSettings { get; private set; }
+
///
/// Gets the ISignInSettingsOperations.
///
@@ -346,6 +371,16 @@ public partial class ApiManagementClient : ServiceClient, I
///
public virtual IReportsOperations Reports { get; private set; }
+ ///
+ /// Gets the ITenantSettingsOperations.
+ ///
+ public virtual ITenantSettingsOperations TenantSettings { get; private set; }
+
+ ///
+ /// Gets the IApiManagementSkusOperations.
+ ///
+ public virtual IApiManagementSkusOperations ApiManagementSkus { get; private set; }
+
///
/// Gets the ISubscriptionOperations.
///
@@ -396,6 +431,11 @@ public partial class ApiManagementClient : ServiceClient, I
///
public virtual IUserConfirmationPasswordOperations UserConfirmationPassword { get; private set; }
+ ///
+ /// Gets the IApiExportOperations.
+ ///
+ public virtual IApiExportOperations ApiExport { get; private set; }
+
///
/// Initializes a new instance of the ApiManagementClient class.
///
@@ -652,12 +692,14 @@ private void Initialize()
ApiIssueAttachment = new ApiIssueAttachmentOperations(this);
ApiTagDescription = new ApiTagDescriptionOperations(this);
Operation = new OperationOperations(this);
- ApiExport = new ApiExportOperations(this);
ApiVersionSet = new ApiVersionSetOperations(this);
AuthorizationServer = new AuthorizationServerOperations(this);
Backend = new BackendOperations(this);
Cache = new CacheOperations(this);
Certificate = new CertificateOperations(this);
+ ContentType = new ContentTypeOperations(this);
+ ContentItem = new ContentItemOperations(this);
+ DeletedServices = new DeletedServicesOperations(this);
ApiManagementOperations = new ApiManagementOperations(this);
ApiManagementServiceSkus = new ApiManagementServiceSkusOperations(this);
ApiManagementService = new ApiManagementServiceOperations(this);
@@ -666,6 +708,7 @@ private void Initialize()
Gateway = new GatewayOperations(this);
GatewayHostnameConfiguration = new GatewayHostnameConfigurationOperations(this);
GatewayApi = new GatewayApiOperations(this);
+ GatewayCertificateAuthority = new GatewayCertificateAuthorityOperations(this);
Group = new GroupOperations(this);
GroupUser = new GroupUserOperations(this);
IdentityProvider = new IdentityProviderOperations(this);
@@ -679,6 +722,8 @@ private void Initialize()
OpenIdConnectProvider = new OpenIdConnectProviderOperations(this);
Policy = new PolicyOperations(this);
PolicyDescription = new PolicyDescriptionOperations(this);
+ PortalRevision = new PortalRevisionOperations(this);
+ PortalSettings = new PortalSettingsOperations(this);
SignInSettings = new SignInSettingsOperations(this);
SignUpSettings = new SignUpSettingsOperations(this);
DelegationSettings = new DelegationSettingsOperations(this);
@@ -691,6 +736,8 @@ private void Initialize()
QuotaByPeriodKeys = new QuotaByPeriodKeysOperations(this);
Region = new RegionOperations(this);
Reports = new ReportsOperations(this);
+ TenantSettings = new TenantSettingsOperations(this);
+ ApiManagementSkus = new ApiManagementSkusOperations(this);
Subscription = new SubscriptionOperations(this);
TagResource = new TagResourceOperations(this);
TenantAccess = new TenantAccessOperations(this);
@@ -701,8 +748,9 @@ private void Initialize()
UserSubscription = new UserSubscriptionOperations(this);
UserIdentities = new UserIdentitiesOperations(this);
UserConfirmationPassword = new UserConfirmationPasswordOperations(this);
+ ApiExport = new ApiExportOperations(this);
BaseUri = new System.Uri("https://management.azure.com");
- ApiVersion = "2019-12-01";
+ ApiVersion = "2020-12-01";
AcceptLanguage = "en-US";
LongRunningOperationRetryTimeout = 30;
GenerateClientRequestId = true;
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementOperations.cs
index 3d769e81740f7..297e0ae8a2104 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementOperations.cs
@@ -60,18 +60,27 @@ internal ApiManagementOperations(ApiManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
/// Thrown when unable to deserialize the response
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- string apiVersion = "2019-12-01";
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -79,7 +88,6 @@ internal ApiManagementOperations(ApiManagementClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
}
@@ -87,9 +95,9 @@ internal ApiManagementOperations(ApiManagementClient client)
var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.ApiManagement/operations").ToString();
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -151,14 +159,13 @@ internal ApiManagementOperations(ApiManagementClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -168,10 +175,6 @@ internal ApiManagementOperations(ApiManagementClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -229,7 +232,7 @@ internal ApiManagementOperations(ApiManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -325,14 +328,13 @@ internal ApiManagementOperations(ApiManagementClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -342,10 +344,6 @@ internal ApiManagementOperations(ApiManagementClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceOperations.cs
index 9265e525e0549..5ee512b2ae5c2 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceOperations.cs
@@ -211,11 +211,14 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -225,7 +228,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -236,9 +238,9 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
_url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -415,11 +417,14 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -428,7 +433,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters);
}
@@ -438,9 +442,9 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -571,7 +575,7 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -588,11 +592,14 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
///
public async Task>> ListWithHttpMessagesAsync(Dictionary> 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");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -600,7 +607,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
}
@@ -609,9 +615,9 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/service").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -673,14 +679,13 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -690,10 +695,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -794,11 +795,14 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -808,7 +812,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetSsoToken", tracingParameters);
}
@@ -819,9 +822,9 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
_url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -981,11 +984,14 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -994,7 +1000,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("parameters", parameters);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters);
}
@@ -1003,9 +1008,9 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1133,9 +1138,182 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
return _result;
}
+ ///
+ /// Get the custom domain ownership identifier for an API Management service.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetDomainOwnershipIdentifierWithHttpMessagesAsync(Dictionary> 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");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetDomainOwnershipIdentifier", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
///
/// Updates the Microsoft.ApiManagement resource running in the Virtual network
- /// to pick the updated network settings.
+ /// to pick the updated DNS changes.
///
///
/// The name of the resource group.
@@ -1231,11 +1409,14 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1246,7 +1427,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("parameters", parameters);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "BeginRestore", tracingParameters);
}
@@ -1257,9 +1437,9 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
_url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1455,11 +1635,14 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1470,7 +1653,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("parameters", parameters);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "BeginBackup", tracingParameters);
}
@@ -1481,9 +1663,9 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
_url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1678,11 +1860,14 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1693,7 +1878,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("parameters", parameters);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
}
@@ -1704,9 +1888,9 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
_url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1914,11 +2098,14 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1929,7 +2116,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("parameters", parameters);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters);
}
@@ -1940,9 +2126,9 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
_url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -2125,11 +2311,14 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2139,7 +2328,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
}
@@ -2150,9 +2338,9 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
_url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -2276,7 +2464,7 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
///
/// Updates the Microsoft.ApiManagement resource running in the Virtual network
- /// to pick the updated network settings.
+ /// to pick the updated DNS changes.
///
///
/// The name of the resource group.
@@ -2336,11 +2524,14 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2351,7 +2542,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("parameters", parameters);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "BeginApplyNetworkConfigurationUpdates", tracingParameters);
}
@@ -2362,9 +2552,9 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
_url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -2672,7 +2862,7 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -2768,14 +2958,13 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -2785,10 +2974,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceOperationsExtensions.cs
index 4349ea6560593..6dd43949c63ab 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceOperationsExtensions.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceOperationsExtensions.cs
@@ -437,9 +437,37 @@ public static ApiManagementServiceNameAvailabilityResult CheckNameAvailability(t
}
}
+ ///
+ /// Get the custom domain ownership identifier for an API Management service.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ public static ApiManagementServiceGetDomainOwnershipIdentifierResult GetDomainOwnershipIdentifier(this IApiManagementServiceOperations operations)
+ {
+ return operations.GetDomainOwnershipIdentifierAsync().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get the custom domain ownership identifier for an API Management service.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetDomainOwnershipIdentifierAsync(this IApiManagementServiceOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetDomainOwnershipIdentifierWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
///
/// Updates the Microsoft.ApiManagement resource running in the Virtual network
- /// to pick the updated network settings.
+ /// to pick the updated DNS changes.
///
///
/// The operations group for this extension method.
@@ -463,7 +491,7 @@ public static ApiManagementServiceNameAvailabilityResult CheckNameAvailability(t
///
/// Updates the Microsoft.ApiManagement resource running in the Virtual network
- /// to pick the updated network settings.
+ /// to pick the updated DNS changes.
///
///
/// The operations group for this extension method.
@@ -729,7 +757,7 @@ public static ApiManagementServiceResource BeginDelete(this IApiManagementServic
///
/// Updates the Microsoft.ApiManagement resource running in the Virtual network
- /// to pick the updated network settings.
+ /// to pick the updated DNS changes.
///
///
/// The operations group for this extension method.
@@ -753,7 +781,7 @@ public static ApiManagementServiceResource BeginDelete(this IApiManagementServic
///
/// Updates the Microsoft.ApiManagement resource running in the Virtual network
- /// to pick the updated network settings.
+ /// to pick the updated DNS changes.
///
///
/// The operations group for this extension method.
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceSkusOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceSkusOperations.cs
index eaa655665a4c3..9d697c4b85486 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceSkusOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceSkusOperations.cs
@@ -108,11 +108,14 @@ internal ApiManagementServiceSkusOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -122,7 +125,6 @@ internal ApiManagementServiceSkusOperations(ApiManagementClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListAvailableServiceSkus", tracingParameters);
}
@@ -133,9 +135,9 @@ internal ApiManagementServiceSkusOperations(ApiManagementClient client)
_url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementSkusOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementSkusOperations.cs
new file mode 100644
index 0000000000000..924ebde120e6d
--- /dev/null
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementSkusOperations.cs
@@ -0,0 +1,397 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.ApiManagement
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// ApiManagementSkusOperations operations.
+ ///
+ internal partial class ApiManagementSkusOperations : IServiceOperations, IApiManagementSkusOperations
+ {
+ ///
+ /// Initializes a new instance of the ApiManagementSkusOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal ApiManagementSkusOperations(ApiManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the ApiManagementClient
+ ///
+ public ApiManagementClient Client { get; private set; }
+
+ ///
+ /// Gets the list of Microsoft.ApiManagement SKUs available for your
+ /// Subscription.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(Dictionary> 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");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/skus").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Gets the list of Microsoft.ApiManagement SKUs available for your
+ /// Subscription.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementSkusOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementSkusOperationsExtensions.cs
new file mode 100644
index 0000000000000..74d2437ed5036
--- /dev/null
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementSkusOperationsExtensions.cs
@@ -0,0 +1,91 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.ApiManagement
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for ApiManagementSkusOperations.
+ ///
+ public static partial class ApiManagementSkusOperationsExtensions
+ {
+ ///
+ /// Gets the list of Microsoft.ApiManagement SKUs available for your
+ /// Subscription.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ public static IPage List(this IApiManagementSkusOperations operations)
+ {
+ return operations.ListAsync().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets the list of Microsoft.ApiManagement SKUs available for your
+ /// Subscription.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IApiManagementSkusOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Gets the list of Microsoft.ApiManagement SKUs available for your
+ /// Subscription.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListNext(this IApiManagementSkusOperations operations, string nextPageLink)
+ {
+ return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets the list of Microsoft.ApiManagement SKUs available for your
+ /// Subscription.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListNextAsync(this IApiManagementSkusOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationOperations.cs
index 3ed6cc3840cca..e3a7050f1b63e 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationOperations.cs
@@ -136,11 +136,14 @@ internal ApiOperationOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "apiId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -153,7 +156,6 @@ internal ApiOperationOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("tags", tags);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByApi", tracingParameters);
}
@@ -177,9 +179,9 @@ internal ApiOperationOperations(ApiManagementClient client)
{
_queryParameters.Add(string.Format("tags={0}", System.Uri.EscapeDataString(tags)));
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -397,11 +399,14 @@ internal ApiOperationOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.MinLength, "operationId", 1);
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -413,7 +418,6 @@ internal ApiOperationOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("operationId", operationId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters);
}
@@ -426,9 +430,9 @@ internal ApiOperationOperations(ApiManagementClient client)
_url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -643,11 +647,14 @@ internal ApiOperationOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.MinLength, "operationId", 1);
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -659,7 +666,6 @@ internal ApiOperationOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("operationId", operationId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -672,9 +678,9 @@ internal ApiOperationOperations(ApiManagementClient client)
_url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -922,11 +928,14 @@ internal ApiOperationOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -940,7 +949,6 @@ internal ApiOperationOperations(ApiManagementClient client)
tracingParameters.Add("operationId", operationId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
@@ -953,9 +961,9 @@ internal ApiOperationOperations(ApiManagementClient client)
_url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1158,6 +1166,9 @@ internal ApiOperationOperations(ApiManagementClient client)
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
@@ -1167,7 +1178,7 @@ internal ApiOperationOperations(ApiManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string operationId, OperationUpdateContract parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string operationId, OperationUpdateContract parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -1234,11 +1245,14 @@ internal ApiOperationOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1252,7 +1266,6 @@ internal ApiOperationOperations(ApiManagementClient client)
tracingParameters.Add("operationId", operationId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
}
@@ -1265,9 +1278,9 @@ internal ApiOperationOperations(ApiManagementClient client)
_url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1341,7 +1354,7 @@ internal ApiOperationOperations(ApiManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 204)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1371,13 +1384,44 @@ internal ApiOperationOperations(ApiManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -1489,11 +1533,14 @@ internal ApiOperationOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1506,7 +1553,6 @@ internal ApiOperationOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("operationId", operationId);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
@@ -1519,9 +1565,9 @@ internal ApiOperationOperations(ApiManagementClient client)
_url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationOperationsExtensions.cs
index bc1bfe9a09855..6b4252619c961 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationOperationsExtensions.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationOperationsExtensions.cs
@@ -304,9 +304,9 @@ public static OperationContract Get(this IApiOperationOperations operations, str
/// header response of the GET request or it should be * for unconditional
/// update.
///
- public static void Update(this IApiOperationOperations operations, string resourceGroupName, string serviceName, string apiId, string operationId, OperationUpdateContract parameters, string ifMatch)
+ public static OperationContract Update(this IApiOperationOperations operations, string resourceGroupName, string serviceName, string apiId, string operationId, OperationUpdateContract parameters, string ifMatch)
{
- operations.UpdateAsync(resourceGroupName, serviceName, apiId, operationId, parameters, ifMatch).GetAwaiter().GetResult();
+ return operations.UpdateAsync(resourceGroupName, serviceName, apiId, operationId, parameters, ifMatch).GetAwaiter().GetResult();
}
///
@@ -342,9 +342,12 @@ public static void Update(this IApiOperationOperations operations, string resour
///
/// The cancellation token.
///
- public static async Task UpdateAsync(this IApiOperationOperations operations, string resourceGroupName, string serviceName, string apiId, string operationId, OperationUpdateContract parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateAsync(this IApiOperationOperations operations, string resourceGroupName, string serviceName, string apiId, string operationId, OperationUpdateContract parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, operationId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, operationId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationPolicyOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationPolicyOperations.cs
index de29d46dee433..838eeb91ee6fc 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationPolicyOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationPolicyOperations.cs
@@ -148,11 +148,14 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.MinLength, "operationId", 1);
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -164,7 +167,6 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("operationId", operationId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByOperation", tracingParameters);
}
@@ -177,9 +179,9 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
_url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -397,12 +399,15 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.MinLength, "operationId", 1);
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string policyId = "policy";
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -415,7 +420,6 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("operationId", operationId);
tracingParameters.Add("policyId", policyId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters);
}
@@ -429,9 +433,9 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
_url = _url.Replace("{policyId}", System.Uri.EscapeDataString(policyId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -649,12 +653,15 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.MinLength, "operationId", 1);
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string policyId = "policy";
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -668,7 +675,6 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
tracingParameters.Add("operationId", operationId);
tracingParameters.Add("format", format);
tracingParameters.Add("policyId", policyId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -686,9 +692,9 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
{
_queryParameters.Add(string.Format("format={0}", System.Uri.EscapeDataString(format)));
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -936,12 +942,15 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string policyId = "policy";
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -956,7 +965,6 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
tracingParameters.Add("policyId", policyId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
@@ -970,9 +978,9 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
_url = _url.Replace("{policyId}", System.Uri.EscapeDataString(policyId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1243,12 +1251,15 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string policyId = "policy";
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1262,7 +1273,6 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
tracingParameters.Add("operationId", operationId);
tracingParameters.Add("policyId", policyId);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
@@ -1276,9 +1286,9 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
_url = _url.Replace("{policyId}", System.Uri.EscapeDataString(policyId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperations.cs
index 15f61b21fc4a2..06ce89468be8a 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperations.cs
@@ -116,11 +116,14 @@ internal ApiOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -133,7 +136,6 @@ internal ApiOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("tags", tags);
tracingParameters.Add("expandApiVersionSet", expandApiVersionSet);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByService", tracingParameters);
}
@@ -160,9 +162,9 @@ internal ApiOperations(ApiManagementClient client)
{
_queryParameters.Add(string.Format("expandApiVersionSet={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expandApiVersionSet, Client.SerializationSettings).Trim('"'))));
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -361,11 +363,14 @@ internal ApiOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "apiId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -376,7 +381,6 @@ internal ApiOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters);
}
@@ -388,9 +392,9 @@ internal ApiOperations(ApiManagementClient client)
_url = _url.Replace("{apiId}", System.Uri.EscapeDataString(apiId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -586,11 +590,14 @@ internal ApiOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "apiId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -601,7 +608,6 @@ internal ApiOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -613,9 +619,9 @@ internal ApiOperations(ApiManagementClient client)
_url = _url.Replace("{apiId}", System.Uri.EscapeDataString(apiId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -816,6 +822,9 @@ internal ApiOperations(ApiManagementClient client)
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
@@ -825,7 +834,7 @@ internal ApiOperations(ApiManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, ApiUpdateContract parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, ApiUpdateContract parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -877,11 +886,14 @@ internal ApiOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -894,7 +906,6 @@ internal ApiOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
}
@@ -906,9 +917,9 @@ internal ApiOperations(ApiManagementClient client)
_url = _url.Replace("{apiId}", System.Uri.EscapeDataString(apiId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -982,7 +993,7 @@ internal ApiOperations(ApiManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 204)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1012,13 +1023,44 @@ internal ApiOperations(ApiManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -1114,11 +1156,14 @@ internal ApiOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1131,7 +1176,6 @@ internal ApiOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("deleteRevisions", deleteRevisions);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
@@ -1147,9 +1191,9 @@ internal ApiOperations(ApiManagementClient client)
{
_queryParameters.Add(string.Format("deleteRevisions={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(deleteRevisions, Client.SerializationSettings).Trim('"'))));
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1322,11 +1366,14 @@ internal ApiOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1338,7 +1385,6 @@ internal ApiOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("includeNotTaggedApis", includeNotTaggedApis);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByTags", tracingParameters);
}
@@ -1361,9 +1407,9 @@ internal ApiOperations(ApiManagementClient client)
{
_queryParameters.Add(string.Format("includeNotTaggedApis={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(includeNotTaggedApis, Client.SerializationSettings).Trim('"'))));
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1580,11 +1626,14 @@ internal ApiOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1597,7 +1646,6 @@ internal ApiOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
}
@@ -1609,9 +1657,9 @@ internal ApiOperations(ApiManagementClient client)
_url = _url.Replace("{apiId}", System.Uri.EscapeDataString(apiId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationsExtensions.cs
index 612881babc54d..98a2691e952bf 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationsExtensions.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiOperationsExtensions.cs
@@ -275,9 +275,9 @@ public static ApiContract Get(this IApiOperations operations, string resourceGro
/// header response of the GET request or it should be * for unconditional
/// update.
///
- public static void Update(this IApiOperations operations, string resourceGroupName, string serviceName, string apiId, ApiUpdateContract parameters, string ifMatch)
+ public static ApiContract Update(this IApiOperations operations, string resourceGroupName, string serviceName, string apiId, ApiUpdateContract parameters, string ifMatch)
{
- operations.UpdateAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch).GetAwaiter().GetResult();
+ return operations.UpdateAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch).GetAwaiter().GetResult();
}
///
@@ -308,9 +308,12 @@ public static void Update(this IApiOperations operations, string resourceGroupNa
///
/// The cancellation token.
///
- public static async Task UpdateAsync(this IApiOperations operations, string resourceGroupName, string serviceName, string apiId, ApiUpdateContract parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateAsync(this IApiOperations operations, string resourceGroupName, string serviceName, string apiId, ApiUpdateContract parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiPolicyOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiPolicyOperations.cs
index 2aed07b6a63ba..0d94d9e73df59 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiPolicyOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiPolicyOperations.cs
@@ -129,11 +129,14 @@ internal ApiPolicyOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "apiId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -144,7 +147,6 @@ internal ApiPolicyOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByApi", tracingParameters);
}
@@ -156,9 +158,9 @@ internal ApiPolicyOperations(ApiManagementClient client)
_url = _url.Replace("{apiId}", System.Uri.EscapeDataString(apiId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -357,12 +359,15 @@ internal ApiPolicyOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "apiId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string policyId = "policy";
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -374,7 +379,6 @@ internal ApiPolicyOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("policyId", policyId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters);
}
@@ -387,9 +391,9 @@ internal ApiPolicyOperations(ApiManagementClient client)
_url = _url.Replace("{policyId}", System.Uri.EscapeDataString(policyId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -588,12 +592,15 @@ internal ApiPolicyOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "apiId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string policyId = "policy";
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -606,7 +613,6 @@ internal ApiPolicyOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("policyId", policyId);
tracingParameters.Add("format", format);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -623,9 +629,9 @@ internal ApiPolicyOperations(ApiManagementClient client)
{
_queryParameters.Add(string.Format("format={0}", System.Uri.EscapeDataString(format)));
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -854,12 +860,15 @@ internal ApiPolicyOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string policyId = "policy";
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -873,7 +882,6 @@ internal ApiPolicyOperations(ApiManagementClient client)
tracingParameters.Add("policyId", policyId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
@@ -886,9 +894,9 @@ internal ApiPolicyOperations(ApiManagementClient client)
_url = _url.Replace("{policyId}", System.Uri.EscapeDataString(policyId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1140,12 +1148,15 @@ internal ApiPolicyOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string policyId = "policy";
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1158,7 +1169,6 @@ internal ApiPolicyOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("policyId", policyId);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
@@ -1171,9 +1181,9 @@ internal ApiPolicyOperations(ApiManagementClient client)
_url = _url.Replace("{policyId}", System.Uri.EscapeDataString(policyId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiProductOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiProductOperations.cs
index 255be550cfdae..223d6a0319999 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiProductOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiProductOperations.cs
@@ -128,11 +128,14 @@ internal ApiProductOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.MinLength, "apiId", 1);
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -144,7 +147,6 @@ internal ApiProductOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByApis", tracingParameters);
}
@@ -164,9 +166,9 @@ internal ApiProductOperations(ApiManagementClient client)
_queryParameters.Add(_odataFilter);
}
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiReleaseOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiReleaseOperations.cs
index 7b43fec251fb8..17637edacc088 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiReleaseOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiReleaseOperations.cs
@@ -131,11 +131,14 @@ internal ApiReleaseOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.MinLength, "apiId", 1);
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -147,7 +150,6 @@ internal ApiReleaseOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByService", tracingParameters);
}
@@ -167,9 +169,9 @@ internal ApiReleaseOperations(ApiManagementClient client)
_queryParameters.Add(_odataFilter);
}
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -385,11 +387,14 @@ internal ApiReleaseOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "releaseId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -401,7 +406,6 @@ internal ApiReleaseOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("releaseId", releaseId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters);
}
@@ -414,9 +418,9 @@ internal ApiReleaseOperations(ApiManagementClient client)
_url = _url.Replace("{releaseId}", System.Uri.EscapeDataString(releaseId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -630,11 +634,14 @@ internal ApiReleaseOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "releaseId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -646,7 +653,6 @@ internal ApiReleaseOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("releaseId", releaseId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -659,9 +665,9 @@ internal ApiReleaseOperations(ApiManagementClient client)
_url = _url.Replace("{releaseId}", System.Uri.EscapeDataString(releaseId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -904,11 +910,14 @@ internal ApiReleaseOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -922,7 +931,6 @@ internal ApiReleaseOperations(ApiManagementClient client)
tracingParameters.Add("releaseId", releaseId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
@@ -935,9 +943,9 @@ internal ApiReleaseOperations(ApiManagementClient client)
_url = _url.Replace("{releaseId}", System.Uri.EscapeDataString(releaseId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1138,6 +1146,9 @@ internal ApiReleaseOperations(ApiManagementClient client)
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
@@ -1147,7 +1158,7 @@ internal ApiReleaseOperations(ApiManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string releaseId, ApiReleaseContract parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string releaseId, ApiReleaseContract parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -1214,11 +1225,14 @@ internal ApiReleaseOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1232,7 +1246,6 @@ internal ApiReleaseOperations(ApiManagementClient client)
tracingParameters.Add("releaseId", releaseId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
}
@@ -1245,9 +1258,9 @@ internal ApiReleaseOperations(ApiManagementClient client)
_url = _url.Replace("{releaseId}", System.Uri.EscapeDataString(releaseId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1321,7 +1334,7 @@ internal ApiReleaseOperations(ApiManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 204)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1351,13 +1364,44 @@ internal ApiReleaseOperations(ApiManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -1468,11 +1512,14 @@ internal ApiReleaseOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1485,7 +1532,6 @@ internal ApiReleaseOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("releaseId", releaseId);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
@@ -1498,9 +1544,9 @@ internal ApiReleaseOperations(ApiManagementClient client)
_url = _url.Replace("{releaseId}", System.Uri.EscapeDataString(releaseId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiReleaseOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiReleaseOperationsExtensions.cs
index 3514fafd69260..2cb57bf7691a8 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiReleaseOperationsExtensions.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiReleaseOperationsExtensions.cs
@@ -292,9 +292,9 @@ public static ApiReleaseContract Get(this IApiReleaseOperations operations, stri
/// header response of the GET request or it should be * for unconditional
/// update.
///
- public static void Update(this IApiReleaseOperations operations, string resourceGroupName, string serviceName, string apiId, string releaseId, ApiReleaseContract parameters, string ifMatch)
+ public static ApiReleaseContract Update(this IApiReleaseOperations operations, string resourceGroupName, string serviceName, string apiId, string releaseId, ApiReleaseContract parameters, string ifMatch)
{
- operations.UpdateAsync(resourceGroupName, serviceName, apiId, releaseId, parameters, ifMatch).GetAwaiter().GetResult();
+ return operations.UpdateAsync(resourceGroupName, serviceName, apiId, releaseId, parameters, ifMatch).GetAwaiter().GetResult();
}
///
@@ -328,9 +328,12 @@ public static void Update(this IApiReleaseOperations operations, string resource
///
/// The cancellation token.
///
- public static async Task UpdateAsync(this IApiReleaseOperations operations, string resourceGroupName, string serviceName, string apiId, string releaseId, ApiReleaseContract parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateAsync(this IApiReleaseOperations operations, string resourceGroupName, string serviceName, string apiId, string releaseId, ApiReleaseContract parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, releaseId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, releaseId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiRevisionOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiRevisionOperations.cs
index 8342d8b7d6fbb..d0d6c826a4f04 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiRevisionOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiRevisionOperations.cs
@@ -128,11 +128,14 @@ internal ApiRevisionOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.MinLength, "apiId", 1);
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -144,7 +147,6 @@ internal ApiRevisionOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByService", tracingParameters);
}
@@ -164,9 +166,9 @@ internal ApiRevisionOperations(ApiManagementClient client)
_queryParameters.Add(_odataFilter);
}
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperations.cs
index d92171e676493..3dffc0888ef5f 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperations.cs
@@ -65,11 +65,11 @@ internal ApiSchemaOperations(ApiManagementClient client)
/// the revision number.
///
///
- /// | Field | Usage | Supported operators | Supported
- /// functions
+ /// | Field | Usage | Supported operators |
+ /// Supported functions
/// |</br>|-------------|-------------|-------------|-------------|</br>|
/// contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains,
- /// startswith, endswith | </br>
+ /// startswith, endswith |</br>
///
///
/// Number of records to return.
@@ -150,11 +150,14 @@ internal ApiSchemaOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0);
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -168,7 +171,6 @@ internal ApiSchemaOperations(ApiManagementClient client)
tracingParameters.Add("filter", filter);
tracingParameters.Add("top", top);
tracingParameters.Add("skip", skip);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByApi", tracingParameters);
}
@@ -192,9 +194,9 @@ internal ApiSchemaOperations(ApiManagementClient client)
{
_queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"'))));
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -416,11 +418,14 @@ internal ApiSchemaOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "schemaId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -432,7 +437,6 @@ internal ApiSchemaOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("schemaId", schemaId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters);
}
@@ -445,9 +449,9 @@ internal ApiSchemaOperations(ApiManagementClient client)
_url = _url.Replace("{schemaId}", System.Uri.EscapeDataString(schemaId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -666,11 +670,14 @@ internal ApiSchemaOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "schemaId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -682,7 +689,6 @@ internal ApiSchemaOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("schemaId", schemaId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -695,9 +701,9 @@ internal ApiSchemaOperations(ApiManagementClient client)
_url = _url.Replace("{schemaId}", System.Uri.EscapeDataString(schemaId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -981,11 +987,14 @@ internal ApiSchemaOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -999,7 +1008,6 @@ internal ApiSchemaOperations(ApiManagementClient client)
tracingParameters.Add("schemaId", schemaId);
tracingParameters.Add("force", force);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
@@ -1016,9 +1024,9 @@ internal ApiSchemaOperations(ApiManagementClient client)
{
_queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"'))));
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1247,11 +1255,14 @@ internal ApiSchemaOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1265,7 +1276,6 @@ internal ApiSchemaOperations(ApiManagementClient client)
tracingParameters.Add("schemaId", schemaId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
}
@@ -1278,9 +1288,9 @@ internal ApiSchemaOperations(ApiManagementClient client)
_url = _url.Replace("{schemaId}", System.Uri.EscapeDataString(schemaId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperationsExtensions.cs
index 6bbea3e1cb31b..3a6aa229b0846 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperationsExtensions.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperationsExtensions.cs
@@ -39,11 +39,11 @@ public static partial class ApiSchemaOperationsExtensions
/// the revision number.
///
///
- /// | Field | Usage | Supported operators | Supported
- /// functions
+ /// | Field | Usage | Supported operators |
+ /// Supported functions
/// |</br>|-------------|-------------|-------------|-------------|</br>|
/// contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains,
- /// startswith, endswith | </br>
+ /// startswith, endswith |</br>
///
///
/// Number of records to return.
@@ -74,11 +74,11 @@ public static partial class ApiSchemaOperationsExtensions
/// the revision number.
///
///
- /// | Field | Usage | Supported operators | Supported
- /// functions
+ /// | Field | Usage | Supported operators |
+ /// Supported functions
/// |</br>|-------------|-------------|-------------|-------------|</br>|
/// contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains,
- /// startswith, endswith | </br>
+ /// startswith, endswith |</br>
///
///
/// Number of records to return.
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiTagDescriptionOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiTagDescriptionOperations.cs
index f39700a340956..74c35d5e26e68 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiTagDescriptionOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiTagDescriptionOperations.cs
@@ -135,11 +135,14 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "apiId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -151,7 +154,6 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByService", tracingParameters);
}
@@ -171,9 +173,9 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
_queryParameters.Add(_odataFilter);
}
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -394,11 +396,14 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "tagDescriptionId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -410,7 +415,6 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("tagDescriptionId", tagDescriptionId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters);
}
@@ -423,9 +427,9 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
_url = _url.Replace("{tagDescriptionId}", System.Uri.EscapeDataString(tagDescriptionId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -644,11 +648,14 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "tagDescriptionId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -660,7 +667,6 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("tagDescriptionId", tagDescriptionId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -673,9 +679,9 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
_url = _url.Replace("{tagDescriptionId}", System.Uri.EscapeDataString(tagDescriptionId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -923,11 +929,18 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
}
+ if (parameters != null)
+ {
+ parameters.Validate();
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -941,7 +954,6 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
tracingParameters.Add("tagDescriptionId", tagDescriptionId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
@@ -954,9 +966,9 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
_url = _url.Replace("{tagDescriptionId}", System.Uri.EscapeDataString(tagDescriptionId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1231,11 +1243,14 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1248,7 +1263,6 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("tagDescriptionId", tagDescriptionId);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
@@ -1261,9 +1275,9 @@ internal ApiTagDescriptionOperations(ApiManagementClient client)
_url = _url.Replace("{tagDescriptionId}", System.Uri.EscapeDataString(tagDescriptionId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiVersionSetOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiVersionSetOperations.cs
index 3805a7dd84015..090b3e57173a0 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiVersionSetOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiVersionSetOperations.cs
@@ -109,11 +109,14 @@ internal ApiVersionSetOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -124,7 +127,6 @@ internal ApiVersionSetOperations(ApiManagementClient client)
tracingParameters.Add("odataQuery", odataQuery);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByService", tracingParameters);
}
@@ -143,9 +145,9 @@ internal ApiVersionSetOperations(ApiManagementClient client)
_queryParameters.Add(_odataFilter);
}
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -343,11 +345,14 @@ internal ApiVersionSetOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "versionSetId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -358,7 +363,6 @@ internal ApiVersionSetOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("versionSetId", versionSetId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters);
}
@@ -370,9 +374,9 @@ internal ApiVersionSetOperations(ApiManagementClient client)
_url = _url.Replace("{versionSetId}", System.Uri.EscapeDataString(versionSetId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -567,11 +571,14 @@ internal ApiVersionSetOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "versionSetId", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -582,7 +589,6 @@ internal ApiVersionSetOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("versionSetId", versionSetId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -594,9 +600,9 @@ internal ApiVersionSetOperations(ApiManagementClient client)
_url = _url.Replace("{versionSetId}", System.Uri.EscapeDataString(versionSetId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -824,11 +830,14 @@ internal ApiVersionSetOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -841,7 +850,6 @@ internal ApiVersionSetOperations(ApiManagementClient client)
tracingParameters.Add("versionSetId", versionSetId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
@@ -853,9 +861,9 @@ internal ApiVersionSetOperations(ApiManagementClient client)
_url = _url.Replace("{versionSetId}", System.Uri.EscapeDataString(versionSetId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1052,6 +1060,9 @@ internal ApiVersionSetOperations(ApiManagementClient client)
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
@@ -1061,7 +1072,7 @@ internal ApiVersionSetOperations(ApiManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string versionSetId, ApiVersionSetUpdateParameters parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string versionSetId, ApiVersionSetUpdateParameters parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -1113,11 +1124,14 @@ internal ApiVersionSetOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1130,7 +1144,6 @@ internal ApiVersionSetOperations(ApiManagementClient client)
tracingParameters.Add("versionSetId", versionSetId);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
}
@@ -1142,9 +1155,9 @@ internal ApiVersionSetOperations(ApiManagementClient client)
_url = _url.Replace("{versionSetId}", System.Uri.EscapeDataString(versionSetId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1218,7 +1231,7 @@ internal ApiVersionSetOperations(ApiManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 204)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1248,13 +1261,44 @@ internal ApiVersionSetOperations(ApiManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -1346,11 +1390,14 @@ internal ApiVersionSetOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1362,7 +1409,6 @@ internal ApiVersionSetOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("versionSetId", versionSetId);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
@@ -1374,9 +1420,9 @@ internal ApiVersionSetOperations(ApiManagementClient client)
_url = _url.Replace("{versionSetId}", System.Uri.EscapeDataString(versionSetId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiVersionSetOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiVersionSetOperationsExtensions.cs
index 69951294111cd..61b51e0b7bc1d 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiVersionSetOperationsExtensions.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiVersionSetOperationsExtensions.cs
@@ -252,9 +252,9 @@ public static ApiVersionSetContract Get(this IApiVersionSetOperations operations
/// header response of the GET request or it should be * for unconditional
/// update.
///
- public static void Update(this IApiVersionSetOperations operations, string resourceGroupName, string serviceName, string versionSetId, ApiVersionSetUpdateParameters parameters, string ifMatch)
+ public static ApiVersionSetContract Update(this IApiVersionSetOperations operations, string resourceGroupName, string serviceName, string versionSetId, ApiVersionSetUpdateParameters parameters, string ifMatch)
{
- operations.UpdateAsync(resourceGroupName, serviceName, versionSetId, parameters, ifMatch).GetAwaiter().GetResult();
+ return operations.UpdateAsync(resourceGroupName, serviceName, versionSetId, parameters, ifMatch).GetAwaiter().GetResult();
}
///
@@ -284,9 +284,12 @@ public static void Update(this IApiVersionSetOperations operations, string resou
///
/// The cancellation token.
///
- public static async Task UpdateAsync(this IApiVersionSetOperations operations, string resourceGroupName, string serviceName, string versionSetId, ApiVersionSetUpdateParameters parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateAsync(this IApiVersionSetOperations operations, string resourceGroupName, string serviceName, string versionSetId, ApiVersionSetUpdateParameters parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, versionSetId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, versionSetId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperations.cs
index cb7b14e9b450d..ebadc79e30e77 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperations.cs
@@ -110,11 +110,14 @@ internal AuthorizationServerOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -125,7 +128,6 @@ internal AuthorizationServerOperations(ApiManagementClient client)
tracingParameters.Add("odataQuery", odataQuery);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByService", tracingParameters);
}
@@ -144,9 +146,9 @@ internal AuthorizationServerOperations(ApiManagementClient client)
_queryParameters.Add(_odataFilter);
}
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -343,11 +345,14 @@ internal AuthorizationServerOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "authsid", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -358,7 +363,6 @@ internal AuthorizationServerOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("authsid", authsid);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters);
}
@@ -370,9 +374,9 @@ internal AuthorizationServerOperations(ApiManagementClient client)
_url = _url.Replace("{authsid}", System.Uri.EscapeDataString(authsid));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -566,11 +570,14 @@ internal AuthorizationServerOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "authsid", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -581,7 +588,6 @@ internal AuthorizationServerOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("authsid", authsid);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -593,9 +599,9 @@ internal AuthorizationServerOperations(ApiManagementClient client)
_url = _url.Replace("{authsid}", System.Uri.EscapeDataString(authsid));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -823,11 +829,14 @@ internal AuthorizationServerOperations(ApiManagementClient client)
{
parameters.Validate();
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -840,7 +849,6 @@ internal AuthorizationServerOperations(ApiManagementClient client)
tracingParameters.Add("authsid", authsid);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
@@ -852,9 +860,9 @@ internal AuthorizationServerOperations(ApiManagementClient client)
_url = _url.Replace("{authsid}", System.Uri.EscapeDataString(authsid));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1051,6 +1059,9 @@ internal AuthorizationServerOperations(ApiManagementClient client)
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
@@ -1060,7 +1071,7 @@ internal AuthorizationServerOperations(ApiManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string authsid, AuthorizationServerUpdateContract parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string authsid, AuthorizationServerUpdateContract parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -1112,11 +1123,14 @@ internal AuthorizationServerOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1129,7 +1143,6 @@ internal AuthorizationServerOperations(ApiManagementClient client)
tracingParameters.Add("authsid", authsid);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
}
@@ -1141,9 +1154,9 @@ internal AuthorizationServerOperations(ApiManagementClient client)
_url = _url.Replace("{authsid}", System.Uri.EscapeDataString(authsid));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1217,7 +1230,7 @@ internal AuthorizationServerOperations(ApiManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 204)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1247,13 +1260,44 @@ internal AuthorizationServerOperations(ApiManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -1344,11 +1388,14 @@ internal AuthorizationServerOperations(ApiManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1360,7 +1407,6 @@ internal AuthorizationServerOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("authsid", authsid);
tracingParameters.Add("ifMatch", ifMatch);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
@@ -1372,9 +1418,9 @@ internal AuthorizationServerOperations(ApiManagementClient client)
_url = _url.Replace("{authsid}", System.Uri.EscapeDataString(authsid));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1519,7 +1565,7 @@ internal AuthorizationServerOperations(ApiManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, string authsid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, string authsid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -1563,11 +1609,14 @@ internal AuthorizationServerOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "authsid", "^[^*#&+:<>?]+$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1578,7 +1627,6 @@ internal AuthorizationServerOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("authsid", authsid);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListSecrets", tracingParameters);
}
@@ -1590,9 +1638,9 @@ internal AuthorizationServerOperations(ApiManagementClient client)
_url = _url.Replace("{authsid}", System.Uri.EscapeDataString(authsid));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -1682,7 +1730,7 @@ internal AuthorizationServerOperations(ApiManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1695,7 +1743,7 @@ internal AuthorizationServerOperations(ApiManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1707,6 +1755,19 @@ internal AuthorizationServerOperations(ApiManagementClient client)
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperationsExtensions.cs
index 77e0a9164cad7..254f1586d6d1f 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperationsExtensions.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperationsExtensions.cs
@@ -250,9 +250,9 @@ public static AuthorizationServerContract Get(this IAuthorizationServerOperation
/// header response of the GET request or it should be * for unconditional
/// update.
///
- public static void Update(this IAuthorizationServerOperations operations, string resourceGroupName, string serviceName, string authsid, AuthorizationServerUpdateContract parameters, string ifMatch)
+ public static AuthorizationServerContract Update(this IAuthorizationServerOperations operations, string resourceGroupName, string serviceName, string authsid, AuthorizationServerUpdateContract parameters, string ifMatch)
{
- operations.UpdateAsync(resourceGroupName, serviceName, authsid, parameters, ifMatch).GetAwaiter().GetResult();
+ return operations.UpdateAsync(resourceGroupName, serviceName, authsid, parameters, ifMatch).GetAwaiter().GetResult();
}
///
@@ -282,9 +282,12 @@ public static void Update(this IAuthorizationServerOperations operations, string
///
/// The cancellation token.
///
- public static async Task UpdateAsync(this IAuthorizationServerOperations operations, string resourceGroupName, string serviceName, string authsid, AuthorizationServerUpdateContract parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateAsync(this IAuthorizationServerOperations operations, string resourceGroupName, string serviceName, string authsid, AuthorizationServerUpdateContract parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, authsid, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, authsid, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
@@ -355,7 +358,7 @@ public static void Delete(this IAuthorizationServerOperations operations, string
///
/// Identifier of the authorization server.
///
- public static ClientSecretContract ListSecrets(this IAuthorizationServerOperations operations, string resourceGroupName, string serviceName, string authsid)
+ public static AuthorizationServerSecretsContract ListSecrets(this IAuthorizationServerOperations operations, string resourceGroupName, string serviceName, string authsid)
{
return operations.ListSecretsAsync(resourceGroupName, serviceName, authsid).GetAwaiter().GetResult();
}
@@ -378,7 +381,7 @@ public static ClientSecretContract ListSecrets(this IAuthorizationServerOperatio
///
/// The cancellation token.
///
- public static async Task ListSecretsAsync(this IAuthorizationServerOperations operations, string resourceGroupName, string serviceName, string authsid, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task ListSecretsAsync(this IAuthorizationServerOperations operations, string resourceGroupName, string serviceName, string authsid, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListSecretsWithHttpMessagesAsync(resourceGroupName, serviceName, authsid, null, cancellationToken).ConfigureAwait(false))
{
diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/BackendOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/BackendOperations.cs
index 6ef7e6da501b6..16f6ed529764d 100644
--- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/BackendOperations.cs
+++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/BackendOperations.cs
@@ -109,11 +109,14 @@ internal BackendOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$");
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -124,7 +127,6 @@ internal BackendOperations(ApiManagementClient client)
tracingParameters.Add("odataQuery", odataQuery);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListByService", tracingParameters);
}
@@ -143,9 +145,9 @@ internal BackendOperations(ApiManagementClient client)
_queryParameters.Add(_odataFilter);
}
}
- if (apiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
@@ -339,11 +341,14 @@ internal BackendOperations(ApiManagementClient client)
throw new ValidationException(ValidationRules.MinLength, "backendId", 1);
}
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-12-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -354,7 +359,6 @@ internal BackendOperations(ApiManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("backendId", backendId);
- tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters);
}
@@ -366,9 +370,9 @@ internal BackendOperations(ApiManagementClient client)
_url = _url.Replace("{backendId}", System.Uri.EscapeDataString(backendId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List