Skip to content

Commit

Permalink
[Azure Search] Fix the definition of WebApiSkill (#7080)
Browse files Browse the repository at this point in the history
* Fix the definition of WebApiSkill + tests
* Add SessionRecord for the new test
* Regenerate the SDK from master branch of mainline repo
* Remove a superfluous, no longer meaningful test case
* Add 2 permutations for headers in test
* Fix up session records
* Add named parameter
  • Loading branch information
arv100kri authored and danieljurek committed Aug 6, 2019
1 parent d5e80c4 commit 9bc2bf8
Show file tree
Hide file tree
Showing 7 changed files with 770 additions and 186 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +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/search/data-plane/Microsoft.Azure.Search.Service/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\repos\azure-sdk-for-net\sdk
2019-07-25 22:29:05 UTC
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Microsoft.Azure.Search.Service/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\src\azure-sdk-for-net\sdk
2019-08-01 17:40:34 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: a28a3fca492d332b0e515f0017551cb692772b29
Commit: 39c47bb0623a056d760175c63688d688e0020faa
AutoRest information
Requested version: latest
Bootstrapper version: autorest@2.0.4283

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Microsoft.Azure.Search.Models
/// A skill that can call a Web API endpoint, allowing you to extend a
/// skillset by having it call your custom code.
/// <see
/// href="https://docs.microsoft.com/azure/search/cognitive-search-custom-skill-interface"
/// href="https://docs.microsoft.com/azure/search/cognitive-search-custom-skill-web-api"
/// />
/// </summary>
[Newtonsoft.Json.JsonObject("#Microsoft.Skills.Custom.WebApiSkill")]
Expand All @@ -43,19 +43,19 @@ public WebApiSkill()
/// Azure Search index, or a value that can be consumed as an input by
/// another skill.</param>
/// <param name="uri">The url for the Web API.</param>
/// <param name="httpHeaders">The headers required to make the http
/// request.</param>
/// <param name="httpMethod">The method for the http request.</param>
/// <param name="description">The description of the skill which
/// describes the inputs, outputs, and usage of the skill.</param>
/// <param name="context">Represents the level at which operations take
/// place, such as the document root or document content (for example,
/// /document or /document/content). The default is /document.</param>
/// <param name="httpHeaders">The headers required to make the http
/// request.</param>
/// <param name="httpMethod">The method for the http request.</param>
/// <param name="timeout">The desired timeout for the request. Default
/// is 30 seconds.</param>
/// <param name="batchSize">The desired batch size which indicates
/// number of documents.</param>
public WebApiSkill(IList<InputFieldMappingEntry> inputs, IList<OutputFieldMappingEntry> outputs, string uri, WebApiHttpHeaders httpHeaders, string httpMethod, string description = default(string), string context = default(string), System.TimeSpan? timeout = default(System.TimeSpan?), int? batchSize = default(int?))
public WebApiSkill(IList<InputFieldMappingEntry> inputs, IList<OutputFieldMappingEntry> outputs, string uri, string description = default(string), string context = default(string), IDictionary<string, string> httpHeaders = default(IDictionary<string, string>), string httpMethod = default(string), System.TimeSpan? timeout = default(System.TimeSpan?), int? batchSize = default(int?))
: base(inputs, outputs, description, context)
{
Uri = uri;
Expand All @@ -81,7 +81,7 @@ public WebApiSkill()
/// Gets or sets the headers required to make the http request.
/// </summary>
[JsonProperty(PropertyName = "httpHeaders")]
public WebApiHttpHeaders HttpHeaders { get; set; }
public IDictionary<string, string> HttpHeaders { get; set; }

/// <summary>
/// Gets or sets the method for the http request.
Expand Down Expand Up @@ -116,14 +116,6 @@ public override void Validate()
{
throw new ValidationException(ValidationRules.CannotBeNull, "Uri");
}
if (HttpHeaders == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "HttpHeaders");
}
if (HttpMethod == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "HttpMethod");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public static IEnumerable<Tuple<string, string, string>> ApiInfo_SearchServiceCl
// 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/search/data-plane/Microsoft.Azure.Search.Service/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\repos\\azure-sdk-for-net\\sdk";
public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Microsoft.Azure.Search.Service/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\src\\azure-sdk-for-net\\sdk";
public static readonly String GithubForkName = "Azure";
public static readonly String GithubBranchName = "master";
public static readonly String GithubCommidId = "a28a3fca492d332b0e515f0017551cb692772b29";
public static readonly String GithubCommidId = "39c47bb0623a056d760175c63688d688e0020faa";
public static readonly String CodeGenerationErrors = "";
public static readonly String GithubRepoName = "azure-rest-api-specs";
// END: Code Generation Metadata Section
Expand Down
Loading

0 comments on commit 9bc2bf8

Please sign in to comment.