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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public async Task CreateListUpdateDelete()
// get policy to check it was added
var getPolicyResponse = await testBase.client.Policy.GetAsync(
testBase.rgName,
testBase.serviceName);
testBase.serviceName,
PolicyExportFormat.Xml);

Assert.NotNull(getPolicyResponse);
Assert.NotNull(getPolicyResponse.Value);
Expand Down Expand Up @@ -172,6 +173,17 @@ public async Task CreateListUpdateDelete()
Assert.NotNull(getApiPolicy);
Assert.NotNull(getApiPolicy.Value);

// get policy in a blob link
var getApiPolicyRawXml = await testBase.client.ApiPolicy.GetAsync(
testBase.rgName,
testBase.serviceName,
api.Name,
PolicyExportFormat.Rawxml);

Assert.NotNull(getApiPolicyRawXml);
Assert.Equal(PolicyExportFormat.Rawxml, getApiPolicyRawXml.Format);
Assert.NotNull(getApiPolicyRawXml.Value);

// get the api policy tag
var apiPolicyTag = await testBase.client.ApiPolicy.GetEntityTagAsync(
testBase.rgName,
Expand Down Expand Up @@ -240,9 +252,11 @@ public async Task CreateListUpdateDelete()
testBase.rgName,
testBase.serviceName,
api.Name,
operation.Name);
operation.Name,
PolicyExportFormat.Xml);

Assert.NotNull(getOperationPolicy);
Assert.Equal(PolicyExportFormat.Xml, getOperationPolicy.Format);
Assert.NotNull(getOperationPolicy.Value);

// get operation policy tag
Expand Down Expand Up @@ -323,6 +337,17 @@ public async Task CreateListUpdateDelete()
Assert.NotNull(getProductPolicy);
Assert.NotNull(getProductPolicy.Value);

// get policy in a blob link
var getProductPolicyXml = await testBase.client.ProductPolicy.GetAsync(
testBase.rgName,
testBase.serviceName,
product.Name,
PolicyExportFormat.Xml);

Assert.NotNull(getProductPolicyXml);
Assert.Equal(PolicyExportFormat.Xml, getProductPolicyXml.Format);
Assert.NotNull(getProductPolicyXml.Value);

// get product policy tag
var productPolicyTag = await testBase.client.ProductPolicy.GetEntityTagAsync(
testBase.rgName,
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,9 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
/// Operation identifier within an API. Must be unique in the current API
/// Management service instance.
/// </param>
/// <param name='format'>
/// Policy Export Format. Possible values include: 'xml', 'rawxml'
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -599,7 +602,7 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<PolicyContract,ApiOperationPolicyGetHeaders>> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string operationId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<PolicyContract,ApiOperationPolicyGetHeaders>> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string operationId, string format = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
Expand Down Expand Up @@ -682,6 +685,7 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("operationId", operationId);
tracingParameters.Add("format", format);
tracingParameters.Add("policyId", policyId);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
Expand All @@ -696,6 +700,10 @@ internal ApiOperationPolicyOperations(ApiManagementClient client)
_url = _url.Replace("{policyId}", System.Uri.EscapeDataString(policyId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List<string> _queryParameters = new List<string>();
if (format != null)
{
_queryParameters.Add(string.Format("format={0}", System.Uri.EscapeDataString(format)));
}
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,12 @@ public static ApiOperationPolicyGetEntityTagHeaders GetEntityTag(this IApiOperat
/// Operation identifier within an API. Must be unique in the current API
/// Management service instance.
/// </param>
public static PolicyContract Get(this IApiOperationPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, string operationId)
/// <param name='format'>
/// Policy Export Format. Possible values include: 'xml', 'rawxml'
/// </param>
public static PolicyContract Get(this IApiOperationPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, string operationId, string format = default(string))
{
return operations.GetAsync(resourceGroupName, serviceName, apiId, operationId).GetAwaiter().GetResult();
return operations.GetAsync(resourceGroupName, serviceName, apiId, operationId, format).GetAwaiter().GetResult();
}

/// <summary>
Expand All @@ -186,12 +189,15 @@ public static PolicyContract Get(this IApiOperationPolicyOperations operations,
/// Operation identifier within an API. Must be unique in the current API
/// Management service instance.
/// </param>
/// <param name='format'>
/// Policy Export Format. Possible values include: 'xml', 'rawxml'
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<PolicyContract> GetAsync(this IApiOperationPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, string operationId, CancellationToken cancellationToken = default(CancellationToken))
public static async Task<PolicyContract> GetAsync(this IApiOperationPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, string operationId, string format = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, operationId, null, cancellationToken).ConfigureAwait(false))
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, operationId, format, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ internal ApiPolicyOperations(ApiManagementClient client)
/// service instance. Non-current revision has ;rev=n as a suffix where n is
/// the revision number.
/// </param>
/// <param name='format'>
/// Policy Export Format. Possible values include: 'xml', 'rawxml'
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -545,7 +548,7 @@ internal ApiPolicyOperations(ApiManagementClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<PolicyContract,ApiPolicyGetHeaders>> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<PolicyContract,ApiPolicyGetHeaders>> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string format = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
Expand Down Expand Up @@ -609,6 +612,7 @@ internal ApiPolicyOperations(ApiManagementClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("apiId", apiId);
tracingParameters.Add("policyId", policyId);
tracingParameters.Add("format", format);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
Expand All @@ -621,6 +625,10 @@ internal ApiPolicyOperations(ApiManagementClient client)
_url = _url.Replace("{policyId}", System.Uri.EscapeDataString(policyId));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List<string> _queryParameters = new List<string>();
if (format != null)
{
_queryParameters.Add(string.Format("format={0}", System.Uri.EscapeDataString(format)));
}
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,12 @@ public static ApiPolicyGetEntityTagHeaders GetEntityTag(this IApiPolicyOperation
/// service instance. Non-current revision has ;rev=n as a suffix where n is
/// the revision number.
/// </param>
public static PolicyContract Get(this IApiPolicyOperations operations, string resourceGroupName, string serviceName, string apiId)
/// <param name='format'>
/// Policy Export Format. Possible values include: 'xml', 'rawxml'
/// </param>
public static PolicyContract Get(this IApiPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, string format = default(string))
{
return operations.GetAsync(resourceGroupName, serviceName, apiId).GetAwaiter().GetResult();
return operations.GetAsync(resourceGroupName, serviceName, apiId, format).GetAwaiter().GetResult();
}

/// <summary>
Expand All @@ -162,12 +165,15 @@ public static PolicyContract Get(this IApiPolicyOperations operations, string re
/// service instance. Non-current revision has ;rev=n as a suffix where n is
/// the revision number.
/// </param>
/// <param name='format'>
/// Policy Export Format. Possible values include: 'xml', 'rawxml'
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<PolicyContract> GetAsync(this IApiPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, CancellationToken cancellationToken = default(CancellationToken))
public static async Task<PolicyContract> GetAsync(this IApiPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, string format = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, null, cancellationToken).ConfigureAwait(false))
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, format, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ public partial interface IApiOperationPolicyOperations
/// Operation identifier within an API. Must be unique in the current
/// API Management service instance.
/// </param>
/// <param name='format'>
/// Policy Export Format. Possible values include: 'xml', 'rawxml'
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
Expand All @@ -122,7 +125,7 @@ public partial interface IApiOperationPolicyOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<PolicyContract,ApiOperationPolicyGetHeaders>> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string operationId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<PolicyContract,ApiOperationPolicyGetHeaders>> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string operationId, string format = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Creates or updates policy configuration for the API Operation
/// level.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ public partial interface IApiPolicyOperations
/// Management service instance. Non-current revision has ;rev=n as a
/// suffix where n is the revision number.
/// </param>
/// <param name='format'>
/// Policy Export Format. Possible values include: 'xml', 'rawxml'
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
Expand All @@ -110,7 +113,7 @@ public partial interface IApiPolicyOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<PolicyContract,ApiPolicyGetHeaders>> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<PolicyContract,ApiPolicyGetHeaders>> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string format = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Creates or updates policy configuration for the API.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ public partial interface IPolicyOperations
/// <param name='serviceName'>
/// The name of the API Management service.
/// </param>
/// <param name='format'>
/// Policy Export Format. Possible values include: 'xml', 'rawxml'
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
Expand All @@ -96,7 +99,7 @@ public partial interface IPolicyOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<PolicyContract,PolicyGetHeaders>> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<PolicyContract,PolicyGetHeaders>> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string format = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Creates or updates the global policy configuration of the Api
/// Management service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ public partial interface IProductPolicyOperations
/// Product identifier. Must be unique in the current API Management
/// service instance.
/// </param>
/// <param name='format'>
/// Policy Export Format. Possible values include: 'xml', 'rawxml'
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
Expand All @@ -106,7 +109,7 @@ public partial interface IProductPolicyOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<PolicyContract,ProductPolicyGetHeaders>> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string productId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<PolicyContract,ProductPolicyGetHeaders>> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string productId, string format = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Creates or updates policy configuration for the Product.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// <auto-generated>
// 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.
// </auto-generated>

namespace Microsoft.Azure.Management.ApiManagement.Models
{

/// <summary>
/// Defines values for PolicyExportFormat.
/// </summary>
public static class PolicyExportFormat
{
/// <summary>
/// The contents are inline and Content type is an XML document.
/// </summary>
public const string Xml = "xml";
/// <summary>
/// The contents are inline and Content type is a non XML encoded
/// policy document.
/// </summary>
public const string Rawxml = "rawxml";
}
}
Loading