Skip to content

Commit

Permalink
Change SkuName and Kind to strings. (#5086)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangyuan authored and shahabhijeet committed Dec 17, 2018
1 parent 2018bbd commit b09512e
Show file tree
Hide file tree
Showing 15 changed files with 90 additions and 215 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public static class CognitiveServicesManagementTestUtilities

// These are used to create default accounts
public static string DefaultLocation = IsTestTenant ? null : "westus";
public const string DefaultSkuName = SkuName.S1;
public const string DefaultKind = Kind.TextAnalytics;
public const string DefaultSkuName = "S1";
public const string DefaultKind = "TextAnalytics";
public static Dictionary<string, string> DefaultTags = new Dictionary<string, string>
{
{"key1","value1"},
Expand Down Expand Up @@ -111,7 +111,7 @@ public static string CreateCognitiveServicesAccount(CognitiveServicesManagementC
return accountName;
}

public static CognitiveServicesAccount CreateAndValidateAccountWithOnlyRequiredParameters(CognitiveServicesManagementClient cognitiveServicesMgmtClient, string rgName, string skuName, string accountType = Kind.TextAnalytics, string location = null)
public static CognitiveServicesAccount CreateAndValidateAccountWithOnlyRequiredParameters(CognitiveServicesManagementClient cognitiveServicesMgmtClient, string rgName, string skuName, string accountType = "TextAnalytics", string location = null)
{
// Create account with only required params
var accountName = TestUtilities.GenerateName("csa");
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,7 @@ internal CheckSkuAvailabilityOperations(CognitiveServicesManagementClient client
/// The SKU of the resource.
/// </param>
/// <param name='kind'>
/// The Kind of the resource. Possible values include: 'Bing.Autosuggest.v7',
/// 'Bing.CustomSearch', 'Bing.Search.v7', 'Bing.Speech', 'Bing.SpellCheck.v7',
/// 'ComputerVision', 'ContentModerator', 'CustomSpeech',
/// 'CustomVision.Prediction', 'CustomVision.Training', 'Emotion', 'Face',
/// 'LUIS', 'QnAMaker', 'SpeakerRecognition', 'SpeechTranslation',
/// 'TextAnalytics', 'TextTranslation', 'WebLM'
/// The Kind of the resource.
/// </param>
/// <param name='type'>
/// The Type of the resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ public static partial class CheckSkuAvailabilityOperationsExtensions
/// The SKU of the resource.
/// </param>
/// <param name='kind'>
/// The Kind of the resource. Possible values include: 'Bing.Autosuggest.v7',
/// 'Bing.CustomSearch', 'Bing.Search.v7', 'Bing.Speech', 'Bing.SpellCheck.v7',
/// 'ComputerVision', 'ContentModerator', 'CustomSpeech',
/// 'CustomVision.Prediction', 'CustomVision.Training', 'Emotion', 'Face',
/// 'LUIS', 'QnAMaker', 'SpeakerRecognition', 'SpeechTranslation',
/// 'TextAnalytics', 'TextTranslation', 'WebLM'
/// The Kind of the resource.
/// </param>
/// <param name='type'>
/// The Type of the resource.
Expand All @@ -64,12 +59,7 @@ public static CheckSkuAvailabilityResultList List(this ICheckSkuAvailabilityOper
/// The SKU of the resource.
/// </param>
/// <param name='kind'>
/// The Kind of the resource. Possible values include: 'Bing.Autosuggest.v7',
/// 'Bing.CustomSearch', 'Bing.Search.v7', 'Bing.Speech', 'Bing.SpellCheck.v7',
/// 'ComputerVision', 'ContentModerator', 'CustomSpeech',
/// 'CustomVision.Prediction', 'CustomVision.Training', 'Emotion', 'Face',
/// 'LUIS', 'QnAMaker', 'SpeakerRecognition', 'SpeechTranslation',
/// 'TextAnalytics', 'TextTranslation', 'WebLM'
/// The Kind of the resource.
/// </param>
/// <param name='type'>
/// The Type of the resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@ public partial interface ICheckSkuAvailabilityOperations
/// The SKU of the resource.
/// </param>
/// <param name='kind'>
/// The Kind of the resource. Possible values include:
/// 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7',
/// 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision',
/// 'ContentModerator', 'CustomSpeech', 'CustomVision.Prediction',
/// 'CustomVision.Training', 'Emotion', 'Face', 'LUIS', 'QnAMaker',
/// 'SpeakerRecognition', 'SpeechTranslation', 'TextAnalytics',
/// 'TextTranslation', 'WebLM'
/// The Kind of the resource.
/// </param>
/// <param name='type'>
/// The Type of the resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,7 @@ public CheckSkuAvailabilityParameter()
/// class.
/// </summary>
/// <param name="skus">The SKU of the resource.</param>
/// <param name="kind">The Kind of the resource. Possible values
/// include: 'Bing.Autosuggest.v7', 'Bing.CustomSearch',
/// 'Bing.Search.v7', 'Bing.Speech', 'Bing.SpellCheck.v7',
/// 'ComputerVision', 'ContentModerator', 'CustomSpeech',
/// 'CustomVision.Prediction', 'CustomVision.Training', 'Emotion',
/// 'Face', 'LUIS', 'QnAMaker', 'SpeakerRecognition',
/// 'SpeechTranslation', 'TextAnalytics', 'TextTranslation',
/// 'WebLM'</param>
/// <param name="kind">The Kind of the resource.</param>
/// <param name="type">The Type of the resource.</param>
public CheckSkuAvailabilityParameter(IList<string> skus, string kind, string type)
{
Expand All @@ -64,13 +57,7 @@ public CheckSkuAvailabilityParameter(IList<string> skus, string kind, string typ
public IList<string> Skus { get; set; }

/// <summary>
/// Gets or sets the Kind of the resource. Possible values include:
/// 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7',
/// 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision',
/// 'ContentModerator', 'CustomSpeech', 'CustomVision.Prediction',
/// 'CustomVision.Training', 'Emotion', 'Face', 'LUIS', 'QnAMaker',
/// 'SpeakerRecognition', 'SpeechTranslation', 'TextAnalytics',
/// 'TextTranslation', 'WebLM'
/// Gets or sets the Kind of the resource.
/// </summary>
[JsonProperty(PropertyName = "kind")]
public string Kind { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,10 @@ public CheckSkuAvailabilityResult()
/// <summary>
/// Initializes a new instance of the CheckSkuAvailabilityResult class.
/// </summary>
/// <param name="kind">The Kind of the resource. Possible values
/// include: 'Bing.Autosuggest.v7', 'Bing.CustomSearch',
/// 'Bing.Search.v7', 'Bing.Speech', 'Bing.SpellCheck.v7',
/// 'ComputerVision', 'ContentModerator', 'CustomSpeech',
/// 'CustomVision.Prediction', 'CustomVision.Training', 'Emotion',
/// 'Face', 'LUIS', 'QnAMaker', 'SpeakerRecognition',
/// 'SpeechTranslation', 'TextAnalytics', 'TextTranslation',
/// 'WebLM'</param>
/// <param name="kind">The Kind of the resource.</param>
/// <param name="type">The Type of the resource.</param>
/// <param name="skuName">The SKU of Cognitive Services account.
/// Possible values include: 'F0', 'P0', 'P1', 'P2', 'S0', 'S1', 'S2',
/// 'S3', 'S4', 'S5', 'S6'</param>
/// <param name="skuName">The SKU of Cognitive Services
/// account.</param>
/// <param name="skuAvailable">Indicates the given SKU is available or
/// not.</param>
/// <param name="reason">Reason why the SKU is not available.</param>
Expand All @@ -62,13 +54,7 @@ public CheckSkuAvailabilityResult()
partial void CustomInit();

/// <summary>
/// Gets or sets the Kind of the resource. Possible values include:
/// 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7',
/// 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision',
/// 'ContentModerator', 'CustomSpeech', 'CustomVision.Prediction',
/// 'CustomVision.Training', 'Emotion', 'Face', 'LUIS', 'QnAMaker',
/// 'SpeakerRecognition', 'SpeechTranslation', 'TextAnalytics',
/// 'TextTranslation', 'WebLM'
/// Gets or sets the Kind of the resource.
/// </summary>
[JsonProperty(PropertyName = "kind")]
public string Kind { get; set; }
Expand All @@ -80,9 +66,7 @@ public CheckSkuAvailabilityResult()
public string Type { get; set; }

/// <summary>
/// Gets or sets the SKU of Cognitive Services account. Possible values
/// include: 'F0', 'P0', 'P1', 'P2', 'S0', 'S1', 'S2', 'S3', 'S4',
/// 'S5', 'S6'
/// Gets or sets the SKU of Cognitive Services account.
/// </summary>
[JsonProperty(PropertyName = "skuName")]
public string SkuName { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,8 @@ public CognitiveServicesAccountCreateParameters()
/// </summary>
/// <param name="sku">Required. Gets or sets the SKU of the
/// resource.</param>
/// <param name="kind">Required. Gets or sets the Kind of the resource.
/// Possible values include: 'Bing.Autosuggest.v7',
/// 'Bing.CustomSearch', 'Bing.Search.v7', 'Bing.Speech',
/// 'Bing.SpellCheck.v7', 'ComputerVision', 'ContentModerator',
/// 'CustomSpeech', 'CustomVision.Prediction', 'CustomVision.Training',
/// 'Emotion', 'Face', 'LUIS', 'QnAMaker', 'SpeakerRecognition',
/// 'SpeechTranslation', 'TextAnalytics', 'TextTranslation',
/// 'WebLM'</param>
/// <param name="kind">Required. Gets or sets the Kind of the
/// resource.</param>
/// <param name="location">Required. Gets or sets the location of the
/// resource. This will be one of the supported and registered Azure
/// Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo
Expand Down Expand Up @@ -81,12 +75,6 @@ public CognitiveServicesAccountCreateParameters()

/// <summary>
/// Gets or sets required. Gets or sets the Kind of the resource.
/// Possible values include: 'Bing.Autosuggest.v7',
/// 'Bing.CustomSearch', 'Bing.Search.v7', 'Bing.Speech',
/// 'Bing.SpellCheck.v7', 'ComputerVision', 'ContentModerator',
/// 'CustomSpeech', 'CustomVision.Prediction', 'CustomVision.Training',
/// 'Emotion', 'Face', 'LUIS', 'QnAMaker', 'SpeakerRecognition',
/// 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM'
/// </summary>
[JsonProperty(PropertyName = "kind")]
public string Kind { get; set; }
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public Sku()
/// Initializes a new instance of the Sku class.
/// </summary>
/// <param name="name">Gets or sets the sku name. Required for account
/// creation, optional for update. Possible values include: 'F0', 'P0',
/// 'P1', 'P2', 'S0', 'S1', 'S2', 'S3', 'S4', 'S5', 'S6'</param>
/// creation, optional for update.</param>
/// <param name="tier">Gets the sku tier. This is based on the SKU
/// name. Possible values include: 'Free', 'Standard',
/// 'Premium'</param>
Expand All @@ -50,8 +49,7 @@ public Sku()

/// <summary>
/// Gets or sets the sku name. Required for account creation, optional
/// for update. Possible values include: 'F0', 'P0', 'P1', 'P2', 'S0',
/// 'S1', 'S2', 'S3', 'S4', 'S5', 'S6'
/// for update.
/// </summary>
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,16 @@ public static IEnumerable<Tuple<string, string, string>> ApiInfo_CognitiveServic
}.AsEnumerable();
}
}
// BEGIN: Code Generation Metadata Section
public static readonly String AutoRestVersion = "latest";
public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283";
public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\Github\\azure-sdk-for-net\\src\\SDKs";
public static readonly String GithubForkName = "Azure";
public static readonly String GithubBranchName = "master";
public static readonly String GithubCommidId = "a5fd13fd813e416fc4500310537491482ad401b3";
public static readonly String CodeGenerationErrors = "";
public static readonly String GithubRepoName = "azure-rest-api-specs";
// END: Code Generation Metadata Section
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@
<PropertyGroup>
<PackageId>Microsoft.Azure.Management.CognitiveServices</PackageId>
<Description>Microsoft Azure Management Cognitive Services Library</Description>
<Version>4.1.1</Version>
<Version>5.0.0</Version>
<AssemblyName>Microsoft.Azure.Management.CognitiveServices</AssemblyName>
<PackageTags>Cognitive Services management;Cognitive Services;</PackageTags>
<PackageReleaseNotes>Taking dependency on 10.0.3 version of Newtonsoft nuget package.</PackageReleaseNotes>
<PackageReleaseNotes>
<![CDATA[
1) SkuName and Kind are now strings.
]]>
</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net452;netstandard1.4</TargetFrameworks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
[assembly: AssemblyTitle("Microsoft Azure Cognitive Services Management Library")]
[assembly: AssemblyDescription("Provides Microsoft Azure Cognitive Services management functions for managing Microsoft Azure Cognitive Services accounts.")]

[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.1.1.0")]
[assembly: AssemblyVersion("5.0.0.0")]
[assembly: AssemblyFileVersion("5.0.0.0")]

[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
Expand Down
16 changes: 5 additions & 11 deletions src/SDKs/_metadata/cognitiveservices_resource-manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@ 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/cognitiveservices/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\azure-sdk-for-net\src\SDKs
2018-09-07 22:25:36 UTC
1) azure-rest-api-specs repository information
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\Github\azure-sdk-for-net\src\SDKs
2018-12-14 01:25:15 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: 7c857063e4b451c7209aa300f01e72665097eaac

2) AutoRest information
Commit: a5fd13fd813e416fc4500310537491482ad401b3
AutoRest information
Requested version: latest
Bootstrapper version: autorest@2.0.4283


Latest installed version:


0 comments on commit b09512e

Please sign in to comment.