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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.

namespace Microsoft.Azure.Management.ApiManagement.Models
{
using System;
using Newtonsoft.Json.Linq;

public partial class SchemaContract
{
/// <summary>
/// Gets the Wsdl Schema from the Document JObject
/// </summary>
public string WsdlSchema
{
get
{
if (!string.IsNullOrWhiteSpace(this.ContentType) &&
this.ContentType.Equals("application/vnd.ms-azure-apim.xsd+xml", StringComparison.OrdinalIgnoreCase))
{
if (this.Document != null)
{
try
{
var documentObject = JObject.Parse(this.Document.ToString());
var result = documentObject["value"];
return result.ToString();
}
catch(Exception)
{
return "Unable to parse the Schema";
}
}
}

return null;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ internal ApiSchemaOperations(ApiManagementClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<SchemaContract,ApiSchemaCreateOrUpdateHeaders>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaContract parameters, string ifMatch = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<SchemaContract,ApiSchemaCreateOrUpdateHeaders>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaCreateOrUpdateContract parameters, string ifMatch = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public static SchemaContract Get(this IApiSchemaOperations operations, string re
/// ETag of the Entity. Not required when creating an entity, but required when
/// updating an entity.
/// </param>
public static SchemaContract CreateOrUpdate(this IApiSchemaOperations operations, string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaContract parameters, string ifMatch = default(string))
public static SchemaContract CreateOrUpdate(this IApiSchemaOperations operations, string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaCreateOrUpdateContract parameters, string ifMatch = default(string))
{
return operations.CreateOrUpdateAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch).GetAwaiter().GetResult();
}
Expand Down Expand Up @@ -279,7 +279,7 @@ public static SchemaContract Get(this IApiSchemaOperations operations, string re
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<SchemaContract> CreateOrUpdateAsync(this IApiSchemaOperations operations, string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaContract parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken))
public static async Task<SchemaContract> CreateOrUpdateAsync(this IApiSchemaOperations operations, string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaCreateOrUpdateContract parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public partial interface IApiSchemaOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<SchemaContract,ApiSchemaCreateOrUpdateHeaders>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaContract parameters, string ifMatch = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<SchemaContract,ApiSchemaCreateOrUpdateHeaders>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaCreateOrUpdateContract parameters, string ifMatch = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Deletes the schema configuration at the Api.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public ApiManagementServiceSkuProperties()
/// <param name="name">Name of the Sku. Possible values include:
/// 'Developer', 'Standard', 'Premium', 'Basic', 'Consumption'</param>
/// <param name="capacity">Capacity of the SKU (number of deployed
/// units of the SKU). The default value is 1.</param>
/// units of the SKU).</param>
public ApiManagementServiceSkuProperties(string name, int? capacity = default(int?))
{
Name = name;
Expand All @@ -57,7 +57,7 @@ public ApiManagementServiceSkuProperties()

/// <summary>
/// Gets or sets capacity of the SKU (number of deployed units of the
/// SKU). The default value is 1.
/// SKU).
/// </summary>
[JsonProperty(PropertyName = "capacity")]
public int? Capacity { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,24 @@ public SchemaContract()
/// </summary>
/// <param name="contentType">Must be a valid a media type used in a
/// Content-Type header as defined in the RFC 2616. Media type of the
/// schema document (e.g. application/json, application/xml).</param>
/// schema document (e.g. application/json, application/xml).
/// &lt;/br&gt; - `Swagger` Schema use
/// `application/vnd.ms-azure-apim.swagger.definitions+json`
/// &lt;/br&gt; - `WSDL` Schema use
/// `application/vnd.ms-azure-apim.xsd+xml` &lt;/br&gt; - `OpenApi`
/// Schema use `application/vnd.oai.openapi.components+json`
/// &lt;/br&gt; - `WADL Schema` use
/// `application/vnd.ms-azure-apim.wadl.grammars+xml`. </param>
/// <param name="id">Resource ID.</param>
/// <param name="name">Resource name.</param>
/// <param name="type">Resource type for API Management
/// resource.</param>
/// <param name="value">Json escaped string defining the document
/// representing the Schema.</param>
public SchemaContract(string contentType, string id = default(string), string name = default(string), string type = default(string), string value = default(string))
/// <param name="document">Properties of the Schema Document.</param>
public SchemaContract(string contentType, string id = default(string), string name = default(string), string type = default(string), object document = default(object))
: base(id, name, type)
{
ContentType = contentType;
Value = value;
Document = document;
CustomInit();
}

Expand All @@ -58,16 +64,22 @@ public SchemaContract()
/// Gets or sets must be a valid a media type used in a Content-Type
/// header as defined in the RFC 2616. Media type of the schema
/// document (e.g. application/json, application/xml).
/// &amp;lt;/br&amp;gt; - `Swagger` Schema use
/// `application/vnd.ms-azure-apim.swagger.definitions+json`
/// &amp;lt;/br&amp;gt; - `WSDL` Schema use
/// `application/vnd.ms-azure-apim.xsd+xml` &amp;lt;/br&amp;gt; -
/// `OpenApi` Schema use `application/vnd.oai.openapi.components+json`
/// &amp;lt;/br&amp;gt; - `WADL Schema` use
/// `application/vnd.ms-azure-apim.wadl.grammars+xml`.
/// </summary>
[JsonProperty(PropertyName = "properties.contentType")]
public string ContentType { get; set; }

/// <summary>
/// Gets or sets json escaped string defining the document representing
/// the Schema.
/// Gets or sets properties of the Schema Document.
/// </summary>
[JsonProperty(PropertyName = "properties.document.value")]
public string Value { get; set; }
[JsonProperty(PropertyName = "properties.document")]
public object Document { get; set; }

/// <summary>
/// Validate the object.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// <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
{
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// Schema Contract details.
/// </summary>
[Rest.Serialization.JsonTransformation]
public partial class SchemaCreateOrUpdateContract : Resource
{
/// <summary>
/// Initializes a new instance of the SchemaCreateOrUpdateContract
/// class.
/// </summary>
public SchemaCreateOrUpdateContract()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the SchemaCreateOrUpdateContract
/// class.
/// </summary>
/// <param name="contentType">Must be a valid a media type used in a
/// Content-Type header as defined in the RFC 2616. Media type of the
/// schema document (e.g. application/json, application/xml).
/// &lt;/br&gt; - `Swagger` Schema use
/// `application/vnd.ms-azure-apim.swagger.definitions+json`
/// &lt;/br&gt; - `WSDL` Schema use
/// `application/vnd.ms-azure-apim.xsd+xml` &lt;/br&gt; - `OpenApi`
/// Schema use `application/vnd.oai.openapi.components+json`
/// &lt;/br&gt; - `WADL Schema` use
/// `application/vnd.ms-azure-apim.wadl.grammars+xml`.</param>
/// <param name="id">Resource ID.</param>
/// <param name="name">Resource name.</param>
/// <param name="type">Resource type for API Management
/// resource.</param>
/// <param name="value">Json escaped string defining the document
/// representing the Schema.</param>
public SchemaCreateOrUpdateContract(string contentType, string id = default(string), string name = default(string), string type = default(string), string value = default(string))
: base(id, name, type)
{
ContentType = contentType;
Value = value;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets must be a valid a media type used in a Content-Type
/// header as defined in the RFC 2616. Media type of the schema
/// document (e.g. application/json, application/xml).
/// &amp;lt;/br&amp;gt; - `Swagger` Schema use
/// `application/vnd.ms-azure-apim.swagger.definitions+json`
/// &amp;lt;/br&amp;gt; - `WSDL` Schema use
/// `application/vnd.ms-azure-apim.xsd+xml` &amp;lt;/br&amp;gt; -
/// `OpenApi` Schema use `application/vnd.oai.openapi.components+json`
/// &amp;lt;/br&amp;gt; - `WADL Schema` use
/// `application/vnd.ms-azure-apim.wadl.grammars+xml`.
/// </summary>
[JsonProperty(PropertyName = "properties.contentType")]
public string ContentType { get; set; }

/// <summary>
/// Gets or sets json escaped string defining the document representing
/// the Schema.
/// </summary>
[JsonProperty(PropertyName = "properties.document.value")]
public string Value { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (ContentType == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ContentType");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Description>Provides ApiManagement management capabilities for Microsoft Azure.</Description>
<AssemblyTitle>Microsoft Azure API Management Management</AssemblyTitle>
<AssemblyName>Microsoft.Azure.Management.ApiManagement</AssemblyName>
<Version>4.9.0-preview</Version>
<Version>4.10.0-preview</Version>
<PackageTags>Microsoft Azure ApiManagement management;API Management;</PackageTags>
<PackageReleaseNotes>Refer https://aka.ms/apimdotnetsdkchangelog for release notes.</PackageReleaseNotes>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyDescription("Provides Api management capabilities for Microsoft Azure.")]

[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.9.0.0")]
[assembly: AssemblyFileVersion("4.10.0.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Azure .NET SDK")]
Expand Down
4 changes: 4 additions & 0 deletions src/SDKs/ApiManagement/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Microsoft.Azure.Management.ApiManagment release notes

### Changes in 4.10.0-preview

- Fixed support for creating, updating Swagger, WSDL and Open Api Schema.

### Changes in 4.9.0-preview

- Added support for retrieving Policies from Global, Api, Product and Operation level in Raw Xml format.
Expand Down
4 changes: 2 additions & 2 deletions src/SDKs/_metadata/apimanagement_resource-manager.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
2019-04-26 17:52:27 UTC
2019-05-01 22:10:09 UTC

1) azure-rest-api-specs repository information
GitHub user: Azure
Branch: master
Commit: a1519161fe16834387b2aa738414cdc8c62c0bf4
Commit: 876236110d3a5c1c6680154cd58f924c9d819c03

2) AutoRest information
Requested version: latest
Expand Down