forked from Azure/autorest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can generate storage schema from swagger
- Loading branch information
Dan Schulte
committed
Apr 20, 2016
1 parent
ce58306
commit a757cc4
Showing
6 changed files
with
396 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
AutoRest/Generators/AzureResourceSchema/AzureResourceSchema/Resource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Microsoft.Rest.Generator.AzureResourceSchema | ||
{ | ||
public class Resource | ||
{ | ||
private readonly string name; | ||
private readonly string type; | ||
private readonly string[] apiVersions; | ||
private readonly IEnumerable<ResourceProperty> properties; | ||
private readonly string description; | ||
|
||
public Resource(string name, string type, string[] apiVersions, IEnumerable<ResourceProperty> properties, string description) | ||
{ | ||
this.name = name; | ||
this.type = type; | ||
this.apiVersions = apiVersions; | ||
this.properties = properties; | ||
this.description = description; | ||
} | ||
|
||
public string Name | ||
{ | ||
get { return name; } | ||
} | ||
|
||
public string Type | ||
{ | ||
get { return type; } | ||
} | ||
|
||
public string[] ApiVersions | ||
{ | ||
get { return apiVersions; } | ||
} | ||
|
||
public IEnumerable<ResourceProperty> Properties | ||
{ | ||
get { return properties; } | ||
} | ||
|
||
public string[] RequiredPropertyNames | ||
{ | ||
get { return Properties.Where(property => property.IsRequired).Select(property => property.Name).ToArray(); } | ||
} | ||
|
||
public string Description | ||
{ | ||
get { return description; } | ||
} | ||
} | ||
} |
Oops, something went wrong.