-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Azure/master
Updating to upstream
- Loading branch information
Showing
62 changed files
with
4,921 additions
and
741 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
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,77 @@ | ||
// | ||
// Copyright (c) Microsoft and contributors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
// Warning: This code was generated by a tool. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if the | ||
// code is regenerated. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Hyak.Common; | ||
|
||
namespace Microsoft.Azure | ||
{ | ||
/// <summary> | ||
/// Resource information. | ||
/// </summary> | ||
public partial class ResourceBase | ||
{ | ||
private string _location; | ||
|
||
/// <summary> | ||
/// Required. Gets or sets the location of the resource. | ||
/// </summary> | ||
public string Location | ||
{ | ||
get { return this._location; } | ||
set { this._location = value; } | ||
} | ||
|
||
private IDictionary<string, string> _tags; | ||
|
||
/// <summary> | ||
/// Optional. Gets or sets the tags attached to the resource. | ||
/// </summary> | ||
public IDictionary<string, string> Tags | ||
{ | ||
get { return this._tags; } | ||
set { this._tags = value; } | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the ResourceBase class. | ||
/// </summary> | ||
public ResourceBase() | ||
{ | ||
this.Tags = new LazyDictionary<string, string>(); | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the ResourceBase class with required | ||
/// arguments. | ||
/// </summary> | ||
public ResourceBase(string location) | ||
: this() | ||
{ | ||
if (location == null) | ||
{ | ||
throw new ArgumentNullException("location"); | ||
} | ||
this.Location = location; | ||
} | ||
} | ||
} |
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,85 @@ | ||
// | ||
// Copyright (c) Microsoft and contributors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
// Warning: This code was generated by a tool. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if the | ||
// code is regenerated. | ||
|
||
using System; | ||
|
||
namespace Microsoft.Azure | ||
{ | ||
/// <summary> | ||
/// Resource information with extended details. | ||
/// </summary> | ||
public partial class ResourceBaseExtended : ResourceBase | ||
{ | ||
private string _id; | ||
|
||
/// <summary> | ||
/// Optional. Gets or sets the ID of the resource. | ||
/// </summary> | ||
public string Id | ||
{ | ||
get { return this._id; } | ||
set { this._id = value; } | ||
} | ||
|
||
private string _name; | ||
|
||
/// <summary> | ||
/// Optional. Gets or sets the name of the resource. | ||
/// </summary> | ||
public string Name | ||
{ | ||
get { return this._name; } | ||
set { this._name = value; } | ||
} | ||
|
||
private string _type; | ||
|
||
/// <summary> | ||
/// Optional. Gets or sets the type of the resource. | ||
/// </summary> | ||
public string Type | ||
{ | ||
get { return this._type; } | ||
set { this._type = value; } | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the ResourceBaseExtended class. | ||
/// </summary> | ||
public ResourceBaseExtended() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the ResourceBaseExtended class with | ||
/// required arguments. | ||
/// </summary> | ||
public ResourceBaseExtended(string location) | ||
: this() | ||
{ | ||
if (location == null) | ||
{ | ||
throw new ArgumentNullException("location"); | ||
} | ||
this.Location = location; | ||
} | ||
} | ||
} |
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,143 @@ | ||
// | ||
// Copyright (c) Microsoft and contributors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
namespace Microsoft.Azure | ||
{ | ||
/// <summary> | ||
/// Resource identity. | ||
/// </summary> | ||
public partial class ResourceIdentity | ||
{ | ||
private string _parentResourcePath; | ||
|
||
/// <summary> | ||
/// Optional. Gets or sets parent resource path (optional). | ||
/// </summary> | ||
public string ParentResourcePath | ||
{ | ||
get { return this._parentResourcePath; } | ||
set { this._parentResourcePath = value; } | ||
} | ||
|
||
private string _resourceName; | ||
|
||
/// <summary> | ||
/// Required. Gets or sets resource name. | ||
/// </summary> | ||
public string ResourceName | ||
{ | ||
get { return this._resourceName; } | ||
set { this._resourceName = value; } | ||
} | ||
|
||
private string _resourceProviderApiVersion; | ||
|
||
/// <summary> | ||
/// Required. Gets or sets API version of the resource provider. | ||
/// </summary> | ||
public string ResourceProviderApiVersion | ||
{ | ||
get { return this._resourceProviderApiVersion; } | ||
set { this._resourceProviderApiVersion = value; } | ||
} | ||
|
||
private string _resourceProviderNamespace; | ||
|
||
/// <summary> | ||
/// Required. Gets or sets namespace of the resource provider. | ||
/// </summary> | ||
public string ResourceProviderNamespace | ||
{ | ||
get { return this._resourceProviderNamespace; } | ||
set { this._resourceProviderNamespace = value; } | ||
} | ||
|
||
private string _resourceType; | ||
|
||
/// <summary> | ||
/// Required. Gets or sets resource type. | ||
/// </summary> | ||
public string ResourceType | ||
{ | ||
get { return this._resourceType; } | ||
set { this._resourceType = value; } | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the ResourceIdentity class. | ||
/// </summary> | ||
public ResourceIdentity() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the ResourceIdentity class. | ||
/// </summary> | ||
public ResourceIdentity(string name, string resourceType, string apiVersion) | ||
{ | ||
ResourceName = name; | ||
ResourceProviderNamespace = GetProviderFromResourceType(resourceType); | ||
ResourceType = GetTypeFromResourceType(resourceType); | ||
ResourceProviderApiVersion = apiVersion; | ||
} | ||
|
||
/// <summary> | ||
/// Returns provider string from resource type. | ||
/// </summary> | ||
/// <param name="resourceType">Resource type.</param> | ||
/// <returns>Provider</returns> | ||
public static string GetProviderFromResourceType(string resourceType) | ||
{ | ||
if (resourceType == null) | ||
{ | ||
return null; | ||
} | ||
|
||
int indexOfSlash = resourceType.IndexOf('/'); | ||
if (indexOfSlash < 0) | ||
{ | ||
return string.Empty; | ||
} | ||
else | ||
{ | ||
return resourceType.Substring(0, indexOfSlash); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Returns type string from resource type. | ||
/// </summary> | ||
/// <param name="resourceType">Resource type.</param> | ||
/// <returns>Type</returns> | ||
public static string GetTypeFromResourceType(string resourceType) | ||
{ | ||
if (resourceType == null) | ||
{ | ||
return null; | ||
} | ||
|
||
int lastIndexOfSlash = resourceType.LastIndexOf('/'); | ||
if (lastIndexOfSlash < 0) | ||
{ | ||
return string.Empty; | ||
} | ||
else | ||
{ | ||
return resourceType.Substring(lastIndexOfSlash + 1); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.