Skip to content

Commit

Permalink
[Azure Search] Merge latest preview changes to psSdkJson6 (#4204)
Browse files Browse the repository at this point in the history
* Search SDK: Re-applying changes from search-4x-preview branch to vs17Dev

I tried rebasing the search-4x-preview branch to vs17Dev, but the results were
very messy, so instead this is just a squash-merge of all the changes. This
should differ from search-4x-preview only in the project files and some minor
test changes to account for behavioral changes in the latest version of
ClientRuntime.

* Search SDK: Fixing failing tests

* Search SDK: Re-recording mocks for the preview SDKs

* Search SDK: Updating copyright dates

* Search SDK: Rename Management SDK project and update build script (#3236)

* Renaming Management.Search to Microsoft.Azure.Management.Search

The package and assembly names were accidentally changed during the VS2017
migration. This fixes it.

* Search SDK: Updating Build-SearchPackages script

* [Azure Search] Merge psSdkJson6 to preview branch (#4114)

* SDK Change for SAP ECC (#4063)

* add new LinkedService for vertica and netezza, update googleBigQuery (#4070)

* add new connector Veritca and Netezza, update Google BigQuery

* add new connector Veritca and Netezza, update Google BigQuery

* update changelog

* resolve conflicts

* update changelog

* ManagementGroups SDK (#4071)

* ManagementGroups SDK

* Minor changes

* Fixing readme (#4066)

* [DataFactory] Updating the SDK version and release notes for 0.5.0 before publishing (#4077)

* Updating ADF SDK version for the release

* Updating ADF SDK version for the release

* Fixing the version for ADF SDK and updating the release notes

* Updated the version in csproj and AssemblyInfo

* Changed version of Microsoft.Azure.Management.Sql to 1.12.0-preview (#4048)

* Adding ZoneBalance and PlatformFaultDomainCount for vm scale set (#4069)

* Content moderator update (#4082)

* Content moderator update

* modified screen text api

* Updated the version

* Improving reliability of SQL ServerKey tests by adding a short wait between key vault creation and key creation (#4072)

* Added more convenient method to rename database (#4056)

* Add convenient Database.Rename methods

Fixes #4055

* Added test recording

* Fixed duplicate release note

* Move custom code into customization folder

* Skps sdk json6 (#4061)

* Added SDK changes for ActionGroup Changes

* added change log entry

* fixed the Nuget.Config

* Commented the unecessary line

* Skipped unecessary test

* Revrted the version change for Newtonsoft library.

* Fixed a comment from SDK team

* Update Monitor.Tests.csproj

* Changed the Assemblyinfo.cs to change the version.

* EventGrid SDK: Removing the preview suffix from the version (#4081)

* Regenerated the SDK and re-recorded the tests based on the newer API version.

* Re-recorded the tests.

* Updated package release notes to reflect this set of changes.

* Re-recorded the tests.

* Updated the SDK based on the latest data-plane API specifications.

* Updated version and release notes.

* Update package version to 1.3.0 to remove the preview suffix.

* Fixed a typo in the release notes.

* Add new features to DataFactory SDK (#4084)

* Add new features
1. SecureOutput and BatchCount
2. Filter Activity
3. LInked Service Parameters
4. FilterActivity

* Update from running Generate.cmd

* Changes corresponding to new swagger PR for API:2018-01-10 (#4075)

* Changes corresponding to new swagger PR for API:2018-01-10

* Fixin tests and updating test jsons

* Updating nuget version to 2.0.0

* Regenerating changes corresponding to comments on swagger PR.

* Updating metadata files as per review comment.

* Addressing review comments

* Changing customConfig to long and making it a required parameter (#4017)

* Regenerating using generate.cmd

* Updating minor nuget version for customsearch

* Updating link for test framework documentation

* Revise notice.txt of Cognitive Services (#4074)

* Revise notice.txt

Revise notice.txt after PMs confirmed with CELA.

* Resolve review comments.

Resolve review comments.

* .NET SDK and its tests for the 2017-10-12  API version (#4076)

* .NET SDK and its tests for the 2017-10-12  API version

* Bump the version and generate the meta data file

* Updated the version and the metadata

* Fixed copyright symbol

* Made the AssemblyVersion and AssemblyFileVersion to match the nuget version

* [App Insights] Adding Data Plane SDK  (#4088)

* Adding initial AI Data Plane

* Updated generated code & added some metric & event extensions

* Added metric extension tests

* Tests & fixes for event extensions

* Updated AI Data Plane SDK

* Minor cleanup to SDK

* Fix typing of eventId, rows

* Fix tests

* Update directory structure; generate.cmd; solution + project files

* Fix solution project file

* regen from pssdkjson6

* add git commit

* adding generated artifacts

* updating csproj, adding build artifacts

* ServiceBus:  properties added to queue and subscription (#4097)

* EnableBatchedOperations property added to queue, DeadLetteringOnFilterEvaluationExceptions added to Subscription

* bump the minor version

* version changed to 1.1.0

* updated resource-manager.txt

* [KeyVault] adding readme.md for data-plane (#4100)

* creating Azure KeyVault SDK readme for data-plane

* readme updates for PR feedback

* Update Azure Database Migration Service to add Managed Instance as target (#4098)

* Update generated files using specs from latest public preview swagger.

* Fix tests.

* Changes:
- Regenerate models to include commit id.
- Update minor version number.

* Add generated AzSdk.RP.props

* Change version number to 0.2.0

* add dataaction attributes to permissions and Role Definition calls (#4079)

* update generated files

* update session recs and generated files

* fix failing tests

* comment extra line

* uncomment assemblyinfo file

* correct the session recs folder

* update session recs file to store and get ids

* add metadata files

* update csproj and assembleinfo file with newer version

* update props file

* update package notes

* [Azure Search] Upgrade data plane to latest AutoRest and split into 4 packages (#4104)

* [Azure Search] Upgrade data plane to the latest version of AutoRest

* [Azure Search] Splitting the data plane into four packages

What's motivating this change is a recognition that the data plane SDK is
really fulfilling three scenarios:

 1. Actually implementing search features in applications (full-text search,
    paging, faceted navigation, etc.)
 2. Indexing data via the push API
 3. Automating the management of indexes, synonyms, indexers, data sources,
    and other service-level resources.

Scenarios 1 and 2 are what you'd normally think of as "data plane". Scenario
3 is closer to "control plane" or management plane, or even "metadata plane"
since managing index schemas in particular is still pretty close to the data.

The split goes something like this:
 - Microsoft.Azure.Search.Data: Fulfills scenarios 1 and 2 above. This covers
   everything under the /docs resource. Currently most of this is custom code.
 - Microsoft.Azure.Search.Service: Fulfills scenario 3 above. This covers all
   top-level resources of the Azure Search Service REST API. This is mostly
   generated code, and our eventual goal is for nearly all of it to be
   generated.
 - Microsoft.Azure.Search.Common: Utilities common to Data and Service.
 - Microsoft.Azure.Search: A stub package that depends on all the others,
   plus defines the Indexes.GetClient() method that acts as a bridge from
   SearchServiceClient to SearchIndexClient. This package provides a
   convenient upgrade path for existing SDK users.

Eventually we're thinking of using Microsoft.Azure.Search.Service in
conjunction with Microsoft.Azure.Management.Search to implement a rich set
of PowerShell CmdLets that can manage indexes, data sources, indexers, etc.
in addition to the ARM-level resources.

* [Azure Search] Factoring out data plane assembly and package versions

Also bumping all data plane package major versions since moving types to
different assemblies is a breaking change.

* [Azure Search] Replacing ConverterBase with JsonReader extension methods

Reuse via inheritance is an anti-pattern, so we're getting rid of it.

* [Azure Search] Fixing issue with copying JsonSerializerSettings

Since the Azure .NET SDKs have to support a wide range of JSON.NET versions,
it isn't safe to reference properties of JsonSerializerSettings by name since
these properties come and go between versions. Instead, we use reflection to
dynamically generate code to copy a JsonSerializerSettings instance.

* [Azure Search] Versioning each data plane package separately

After some discussion, we decided it was better for the purposes of decoupled
development and release that we version each of the data plane packages
separately.

* [Azure Search] Add new parameters for Base64Encode and Decode field mapping functions

* [Azure Search] Fixed bug in ModelComparer that may affect some tests

* [Azure Search] Added ParseText, removed obsolete APIs, and marked another API obsolete

* [Azure Search] Add test coverage for warnings

* [Azure Search] Adding Service Statistics API

* [Azure Search] Improving ServiceStatsTests

* Azure Search: Removing indexer related limits from service statistics API

* [Azure Search] Merge psSdkJson6 to search-4x-preview-vs17 (#4197)

* SDK Change for SAP ECC (#4063)

* add new LinkedService for vertica and netezza, update googleBigQuery (#4070)

* add new connector Veritca and Netezza, update Google BigQuery

* add new connector Veritca and Netezza, update Google BigQuery

* update changelog

* resolve conflicts

* update changelog

* ManagementGroups SDK (#4071)

* ManagementGroups SDK

* Minor changes

* Fixing readme (#4066)

* [DataFactory] Updating the SDK version and release notes for 0.5.0 before publishing (#4077)

* Updating ADF SDK version for the release

* Updating ADF SDK version for the release

* Fixing the version for ADF SDK and updating the release notes

* Updated the version in csproj and AssemblyInfo

* Changed version of Microsoft.Azure.Management.Sql to 1.12.0-preview (#4048)

* Adding ZoneBalance and PlatformFaultDomainCount for vm scale set (#4069)

* Content moderator update (#4082)

* Content moderator update

* modified screen text api

* Updated the version

* Improving reliability of SQL ServerKey tests by adding a short wait between key vault creation and key creation (#4072)

* Added more convenient method to rename database (#4056)

* Add convenient Database.Rename methods

Fixes #4055

* Added test recording

* Fixed duplicate release note

* Move custom code into customization folder

* Skps sdk json6 (#4061)

* Added SDK changes for ActionGroup Changes

* added change log entry

* fixed the Nuget.Config

* Commented the unecessary line

* Skipped unecessary test

* Revrted the version change for Newtonsoft library.

* Fixed a comment from SDK team

* Update Monitor.Tests.csproj

* Changed the Assemblyinfo.cs to change the version.

* EventGrid SDK: Removing the preview suffix from the version (#4081)

* Regenerated the SDK and re-recorded the tests based on the newer API version.

* Re-recorded the tests.

* Updated package release notes to reflect this set of changes.

* Re-recorded the tests.

* Updated the SDK based on the latest data-plane API specifications.

* Updated version and release notes.

* Update package version to 1.3.0 to remove the preview suffix.

* Fixed a typo in the release notes.

* Add new features to DataFactory SDK (#4084)

* Add new features
1. SecureOutput and BatchCount
2. Filter Activity
3. LInked Service Parameters
4. FilterActivity

* Update from running Generate.cmd

* Changes corresponding to new swagger PR for API:2018-01-10 (#4075)

* Changes corresponding to new swagger PR for API:2018-01-10

* Fixin tests and updating test jsons

* Updating nuget version to 2.0.0

* Regenerating changes corresponding to comments on swagger PR.

* Updating metadata files as per review comment.

* Addressing review comments

* Changing customConfig to long and making it a required parameter (#4017)

* Regenerating using generate.cmd

* Updating minor nuget version for customsearch

* Updating link for test framework documentation

* Revise notice.txt of Cognitive Services (#4074)

* Revise notice.txt

Revise notice.txt after PMs confirmed with CELA.

* Resolve review comments.

Resolve review comments.

* .NET SDK and its tests for the 2017-10-12  API version (#4076)

* .NET SDK and its tests for the 2017-10-12  API version

* Bump the version and generate the meta data file

* Updated the version and the metadata

* Fixed copyright symbol

* Made the AssemblyVersion and AssemblyFileVersion to match the nuget version

* [App Insights] Adding Data Plane SDK  (#4088)

* Adding initial AI Data Plane

* Updated generated code & added some metric & event extensions

* Added metric extension tests

* Tests & fixes for event extensions

* Updated AI Data Plane SDK

* Minor cleanup to SDK

* Fix typing of eventId, rows

* Fix tests

* Update directory structure; generate.cmd; solution + project files

* Fix solution project file

* regen from pssdkjson6

* add git commit

* adding generated artifacts

* updating csproj, adding build artifacts

* ServiceBus:  properties added to queue and subscription (#4097)

* EnableBatchedOperations property added to queue, DeadLetteringOnFilterEvaluationExceptions added to Subscription

* bump the minor version

* version changed to 1.1.0

* updated resource-manager.txt

* [KeyVault] adding readme.md for data-plane (#4100)

* creating Azure KeyVault SDK readme for data-plane

* readme updates for PR feedback

* Update recommendation engine APIs and their test

* Generating SDK based on 2018-03-01-preview version.

* Generate sdk from swagger, add new test for cancel pool operation and list database/pool operation

* Update Azure Database Migration Service to add Managed Instance as target (#4098)

* Update generated files using specs from latest public preview swagger.

* Fix tests.

* Changes:
- Regenerate models to include commit id.
- Update minor version number.

* Add generated AzSdk.RP.props

* Change version number to 0.2.0

* Deleting old session records.

* Adding zone scenario tests for Private DNS.

* Modifying RecordSet tests for Private zones.

* Including session records again.

* Bumping up the version.

* Re-generating the SDK based from generate.cmd (fork: owolabi2/private-dns-public-preview).

* Update recommendation engine APIs and their test

* Fix assembly version and VersionPrefix, add .props file

* add dataaction attributes to permissions and Role Definition calls (#4079)

* update generated files

* update session recs and generated files

* fix failing tests

* comment extra line

* uncomment assemblyinfo file

* correct the session recs folder

* update session recs file to store and get ids

* add metadata files

* update csproj and assembleinfo file with newer version

* update props file

* update package notes

* Fix versions in .csproj files

* [Azure Search] Upgrade data plane to latest AutoRest and split into 4 packages (#4104)

* [Azure Search] Upgrade data plane to the latest version of AutoRest

* [Azure Search] Splitting the data plane into four packages

What's motivating this change is a recognition that the data plane SDK is
really fulfilling three scenarios:

 1. Actually implementing search features in applications (full-text search,
    paging, faceted navigation, etc.)
 2. Indexing data via the push API
 3. Automating the management of indexes, synonyms, indexers, data sources,
    and other service-level resources.

Scenarios 1 and 2 are what you'd normally think of as "data plane". Scenario
3 is closer to "control plane" or management plane, or even "metadata plane"
since managing index schemas in particular is still pretty close to the data.

The split goes something like this:
 - Microsoft.Azure.Search.Data: Fulfills scenarios 1 and 2 above. This covers
   everything under the /docs resource. Currently most of this is custom code.
 - Microsoft.Azure.Search.Service: Fulfills scenario 3 above. This covers all
   top-level resources of the Azure Search Service REST API. This is mostly
   generated code, and our eventual goal is for nearly all of it to be
   generated.
 - Microsoft.Azure.Search.Common: Utilities common to Data and Service.
 - Microsoft.Azure.Search: A stub package that depends on all the others,
   plus defines the Indexes.GetClient() method that acts as a bridge from
   SearchServiceClient to SearchIndexClient. This package provides a
   convenient upgrade path for existing SDK users.

Eventually we're thinking of using Microsoft.Azure.Search.Service in
conjunction with Microsoft.Azure.Management.Search to implement a rich set
of PowerShell CmdLets that can manage indexes, data sources, indexers, etc.
in addition to the ARM-level resources.

* [Azure Search] Factoring out data plane assembly and package versions

Also bumping all data plane package major versions since moving types to
different assemblies is a breaking change.

* [Azure Search] Replacing ConverterBase with JsonReader extension methods

Reuse via inheritance is an anti-pattern, so we're getting rid of it.

* [Azure Search] Fixing issue with copying JsonSerializerSettings

Since the Azure .NET SDKs have to support a wide range of JSON.NET versions,
it isn't safe to reference properties of JsonSerializerSettings by name since
these properties come and go between versions. Instead, we use reflection to
dynamically generate code to copy a JsonSerializerSettings instance.

* [Azure Search] Versioning each data plane package separately

After some discussion, we decided it was better for the purposes of decoupled
development and release that we version each of the data plane packages
separately.

* Add web_resource-manager.txt

* "automation" was misspelled (#4107)

* Bumping up the version again to 2.2.0 since 2.1.0 will be used by 2017-10-01 API version.

* Update AzureApiTag to AzSdk.RP.props and add SdkInfo_WebSiteManagementClient.cs

* Re-generating the SDK making the ZoneType optional.

* [Monitor] SDK version 0.19.0-preview  (#4108)

* [Monitor] SDK version 0.19.0-preview

* [Monitor] SDK version 0.19.0-preview

* [Monitor] SDK version 0.19.0-preview

* [Monitor] SDK version 0.19.0-preview

* [Monitor] SDK version 0.19.0-preview

* [Monitor] SDK version 0.19.0-preview

* initial commit - need to fix usage test case

initial commit - need to fix usage test case

* Add first version of .NET SDK for Policy Insights RP (#4117)

* Add SDK for PolicyInsights with initial set of tests (incomplete)

* Rest of the scope tests

* Minor changes

* Add query option tests

* Add policy insights to documentation files

* Changes requested as part of PR

* Fix generate.cmd
* Run generate to generate metadata
* Change version as suggested
* Remove hardcoded paths
* Add subscription ID to recorded session data instead of setting it in code
* Remove commented out code

* [Apim] Autorest based .NET client on 2018-01-01 version with Tests (#4115)

* 2018-01-01 client and basic tests

* Updated tests and generated expected metadata artifacts

* Fix ApiRevisionId and other test fixes

* Extension fixes

* update roledefinition filters (#4102)

* update tests to include type filter for roledefinitions

* update version

* rerecord tests

* Update DNS SDK for 2017-10-01 API Version (#4118)

* Update Azure DNS SDK for 2017-10-01 API Version

* Update test recordings for DNS SDK 2017-10-01 API Version

* Update 2017-10-01 DNS API version Swagger based on code review feedback

* Re-generate DNS SDK from 2017-10-01 official swagger

* Add AzSdk.RP.props for DNS SDK

* Including changes for 2017-10-01 API version.

* Re-recording all tests.

* Minor refactoring.

* Fixing duplicated lines.

* Regenerate to correct  limit/currentValue types

Regenerate with the latest swagger to correct  limit/currentValue types.
Now Usage UT can pass.

* Bump version to 4.0.0.0

Bump version to 4.0.0.0

* Update RecordSession for CognitiveServicesAccountUpdateWithCreateTest

Update RecordSession for CognitiveServicesAccountUpdateWithCreateTest

* Generating SDK against merged Swagger.

* capitalizing DNS in csproj

* Downgrading assemblyversion to 2.1.0.0

*   * Add AzureDatabricks LinkedService and DatabricksNotebook Activity
  * Add headNodeSize and dataNodeSize properties in HDInsightOnDemand LinkedService.
  * Add LinkedService, Dataset, CopySource for SalesforceMarketingCloud

* Generating DNS client from latest Swagger changes

* Updating DiskRP API version to 2018-04-01 and adding zone resilient property to image storage profile (#4129)

* Sync the SDK repo with original. Sync official rest-api-specs with checked-in changes and renenerate the SDK

* Introducing generate.ps1 to replace generate.cmd (#4123)

* Adding generate.ps1

* better logging, hooks for generate.cmd

* Addressing comments

* Addressing PR comments

* [Monitor] Fixing bug #2655: the top argument of the Metrics API must be a integer instead of a double

* Fixing remove-module error (#4133)

* Update Auditing & ThreatDetection tests. (#4127)

Re-recorded tests with updated expecations due to minor changes in service behavior.

* generate the .net sdk from official swagger repo azure/azure-rest-api-specs. Bump the api version in Assembly file and csproj

* regenerate the sdk since the swagger is updated

* [Monitor] Adding metadata file to PR

* Update ElasticPool test, only sleep when in Record mode

* do a git clean on working branch, rerun generate.cmd

* delete the release note for sdk version 1.12.0-preview

* logging invoker information to file (#4137)

* fix build issue in ElasticPoolCrudScenarioTests.cs

* Add missing test for vmss redeploy and perform maintenance. (#4135)

* Updating ADF SDK version and release notes before publishing (#4138)

* Update changelog.md

Updating the change log for release

* Update Microsoft.Azure.Management.DataFactory.csproj

Updating proj file with release notes

* Determining sdkdirectory for powershell invokers

* Regen from swagger

* LTR tests

* Adding tests that are actually recordable.

* Updating version info

* Ran msbuild build.proj /t:Build /p:Scope=SDKs\SqlManagement per request.

* Bump up managementpartner sdk version and change the package release notes

* Undo version changes and add release notes for the newly added APIs and the breaking changes

* [Monitor] Unblocking the publication of the SDK (#4141)

* Address comments pertaining to tests

* Adding tests for all LRO Rules agreed upon with ARM team. (#4142)

* Adding tests for all LRO Rules agreed upon with ARM team. Accomodating 404, 204 for delete on Final GET. Accomodating text/plain content type certain RP still sending under pretext of application/json

* Updating E2E Scenario test

* Move Bing Search SDKs from Preview to GA

* Updating ClientRuntime release notes as well as version (#4145)

* Regen from master

Regenerated from master, only the sql_resource-manager.txt is changed.

* rerun generate.cmd to generate sdk

* Add generate.ps1 script and run it

* remove sdkDirectory argument in generate.ps1 script

* Fixing compute script and error handling fixes

* Address Comments

* Adding instructions to generate code

* instructions to generate code from custom repo

* 1. Re-generate SDK
2. Update existing session records to reflect updated api-version

* reverting generate.cmd to old behavior

* Update SDK and test for BatchAI for GA

* Add enrollment account tests.

* Rev version.

* 1. update SDK version 2. add PS generate script

* Fix versions.

* Add generate.ps1

* update release note for GA BatchAI SDKs

* WebSites ResourceHealthMetadata APIs and Tests

Adding the Microsoft.Web ResourceHealthMetadata APIs as well as new test cases for these APIs

* Updating WebSites SDK versions

Updating WebSites SDK versions

* Minor test naming fixes.

* Re-generate using generate.ps1.

* Update Azure Batch .Net SDK to meet API version 2018-03-01.6.1. (#4151)

* Regenerate protocol based on 2018-02 Swagger spec

* Add object model layer for new APIs

* Update MSBuild version for ProxyLayerParser

* Add tests for new APIs

* Update Batch version to 8.1.0

 - Updated the changelog as well.

* Update to latest swagger spec.

* Add AzSdk.RP.props to source.

* Move LogUpload test case to IaaS pool.

* Add Custom Vision Training and Prediction projects
Add session recordings for tests

* Update version

* Update versions + generation scripts

* ReRecord failed test due to CR upgrade. (#4159)

* RPs whose tests have to be re recorded after CR update across the repo. Adding missing meta data files. Updating few test projects that have not been authored correctly

* ReRecording ApiManagement tests due to ClientRuntime update

* ApiMgmt, BatchMgmt and cdn rerecorded tests for CR update

* ReRecording Compute, Dns, MLCompute, RecSvcSiteRecovery, Sql, StreamAnalytics

* ReRecording DataFactory, EventHub, NotificaitonHub, Relay, StorSimple and TrafficManager tests due to CR change

* ReRecording ContainerRegistry, DataMigration, HDInsights, KeyVault, PowerBIDedicated, RedisCache, Resource, ServiceBus tests for CR Update

* ReRecording Customer Insights, EventGrid, MachineLearning test due to CR update.

* Fixing improper merge

* ReRecording Fabric.Admin tests due to CR update

* Fixing encoding so github can see diffs

* Update BatchAI test record

* Re-recording tests and fixes

* subscription-2018-03-01-preview (#4157)

* subscription-2018-03-01-preview

* ran generate.ps1

* minor fixes

* reran tests

* added package release notes and bumped version

* pulled upstream changes, reran generate.ps1

* fix csproj

* fixed props

* Update package information (#4163)

* restore point create and delete API missed test added (#4168)

* ServiceBus: 'properties' added to Rules CorrelationFilter (#4167)

* Added 'properties' in correlation filter

* updated session records

* code generated using generate.ps1

* adding license header to gen tool (#4173)

* adding license header to gen tool

* Update generateTool.ps1

* Update sdk with latest swagger spec.

* Update generated data

* Bump version

* Update tests

* fixing xml comment on KeyWrapAlgorithm.CreateDecryptor

* .Net SDK for PostgreSQL. (#4175)

* .Net SDK for PostgreSQL..

* Update test recordings.

* Resolve PR comments.

* Update props file and add metadata

* Update test recordings.

* Handle PR feedback.

* Update release notes

* Update .props file

* Update .props file

* Fix .props file

* Generate again with hotfix changes

* Add generate.ps1

* Regenerate with generate.ps1

* Update props file

* Regenerated Commerce Admin

* Updated version and generate script

* Added generate.ps1, regenerated, including some text file

* [Azure Search] Replacing generate.cmd with generate.ps1 and regenerating all code
  • Loading branch information
brjohnstmsft authored and shahabhijeet committed Apr 11, 2018
1 parent 1e7e420 commit 0af3868
Show file tree
Hide file tree
Showing 54 changed files with 5,094 additions and 2,854 deletions.

This file was deleted.

20 changes: 0 additions & 20 deletions src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate.cmd

This file was deleted.

46 changes: 46 additions & 0 deletions src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ----------------------------------------------------------------------------------

<#
.SYNOPSIS
Powershell script that generates the C# SDK code for Microsoft.Azure.Search.Data from a Swagger spec
.DESCRIPTION
This script:
- fetches the config file from user/branch provided
- Generates code based off the config file provided
.PARAMETER SpecsRepoFork
The Rest Spec repo fork which contains the config file; the default is Azure.
.PARAMETER SpecsRepoBranch
The Branch which contains the config file; the default is master.
#>

Param(
[string] $SpecsRepoFork = "Azure",
[string] $SpecsRepoBranch = "master"
)

$repoRoot = "$PSScriptRoot\..\..\..\..\.."
$generateFolder = "$PSScriptRoot\Generated"

powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File "$repoRoot\tools\generateTool.ps1" -ResourceProvider "search/data-plane/Microsoft.Azure.Search.Data" -PowershellInvoker -AutoRestVersion "latest" -SpecsRepoFork $SpecsRepoFork -SpecsRepoBranch $SpecsRepoBranch

Write-Output "Deleting extra files and cleaning up..."

# Delete any extra files generated for types that are shared between SearchServiceClient and SearchIndexClient.
Remove-Item "$generateFolder\Models\SearchRequestOptions.cs"

# Delete extra files we don't need.
Remove-Item "$generateFolder\DocumentsProxyOperationsExtensions.cs"

# Make any necessary modifications
powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File .\Fix-GeneratedCode.ps1

Write-Output "Finished cleanup."
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,72 @@ public partial class FieldMappingFunction
/// the input is UTF-8 encoded.
/// </summary>
/// <remarks>
/// <para>Sample use case: Only URL-safe characters can appear in an Azure Search document key (because customers
/// must be able to address the document using the Lookup API, for example). If your data contains URL-unsafe
/// characters and you want to use it to populate a key field in your search index, use this function.
/// </para>
/// <para>
/// For details on the encoding used, see <see href="https://docs.microsoft.com/azure/search/search-indexer-field-mappings#details-of-base64-encoding-and-decoding"/>.
/// Calling this method is the same as calling <c cref="Base64Encode(bool)"/> with <c>useHttpServerUtilityUrlTokenEncode</c> set to <c>true</c>.
/// </para>
/// </remarks>
/// <returns>A new field mapping function.</returns>
public static FieldMappingFunction Base64Encode() => new FieldMappingFunction("base64Encode");

/// <summary>
/// Creates a field mapping function that performs URL-safe Base64 encoding of the input string. Assumes that
/// the input is UTF-8 encoded.
/// </summary>
/// <param name="useHttpServerUtilityUrlTokenEncode">Determines how Base64 encoding is performed. See <see href="https://docs.microsoft.com/azure/search/search-indexer-field-mappings#details-of-base64-encoding-and-decoding"/> for details.</param>
/// <remarks>
/// Sample use case: Only URL-safe characters can appear in an Azure Search document key (because customers
/// must be able to address the document using the Lookup API, for example). If your data contains URL-unsafe
/// characters and you want to use it to populate a key field in your search index, use this function.
/// </remarks>
/// <returns>A new field mapping function.</returns>
public static FieldMappingFunction Base64Encode()
{
return new FieldMappingFunction("base64Encode");
}
public static FieldMappingFunction Base64Encode(bool useHttpServerUtilityUrlTokenEncode) =>
new FieldMappingFunction(
"base64Encode",
new Dictionary<string, object>
{
[nameof(useHttpServerUtilityUrlTokenEncode)] = useHttpServerUtilityUrlTokenEncode
});

/// <summary>
/// Creates a field mapping function that performs Base64 decoding of the input string. The input is assumed
/// to a URL-safe Base64-encoded string.
/// </summary>
/// <remarks>
/// <para>Sample use case: Blob custom metadata values must be ASCII-encoded. You can use Base64 encoding to
/// represent arbitrary Unicode strings in blob custom metadata. However, to make search meaningful, you can
/// use this function to turn the encoded data back into "regular" strings when populating your search index.
/// </para>
/// <para>
/// For details on the decoding used, see <see href="https://docs.microsoft.com/azure/search/search-indexer-field-mappings#details-of-base64-encoding-and-decoding"/>.
/// Calling this method is the same as calling <c cref="Base64Decode(bool)"/> with <c>useHttpServerUtilityUrlTokenDecode</c> set to <c>true</c>.
/// </para>
/// </remarks>
/// <returns>A new field mapping function.</returns>
public static FieldMappingFunction Base64Decode() => new FieldMappingFunction("base64Decode");

/// <summary>
/// Creates a field mapping function that performs Base64 decoding of the input string. The input is assumed
/// to a URL-safe Base64-encoded string.
/// </summary>
/// <param name="useHttpServerUtilityUrlTokenDecode">Determines how Base64 decoding is performed. See <see href="https://docs.microsoft.com/azure/search/search-indexer-field-mappings#details-of-base64-encoding-and-decoding"/> for details.</param>
/// <remarks>
/// Sample use case: Blob custom metadata values must be ASCII-encoded. You can use Base64 encoding to
/// represent arbitrary Unicode strings in blob custom metadata. However, to make search meaningful, you can
/// use this function to turn the encoded data back into "regular" strings when populating your search index.
/// </remarks>
/// <returns>A new field mapping function.</returns>
public static FieldMappingFunction Base64Decode()
{
return new FieldMappingFunction("base64Decode");
}
public static FieldMappingFunction Base64Decode(bool useHttpServerUtilityUrlTokenDecode) =>
new FieldMappingFunction(
"base64Decode",
new Dictionary<string, object>
{
[nameof(useHttpServerUtilityUrlTokenDecode)] = useHttpServerUtilityUrlTokenDecode
});

/// <summary>
/// Creates a field mapping function that splits a string field using the specified delimiter, and picks the
Expand All @@ -57,17 +99,14 @@ public static FieldMappingFunction Base64Decode()
/// </para>
/// </remarks>
/// <returns>A new field mapping function.</returns>
public static FieldMappingFunction ExtractTokenAtPosition(string delimiter, int position)
{
var parameters =
new Dictionary<string, object>()
public static FieldMappingFunction ExtractTokenAtPosition(string delimiter, int position) =>
new FieldMappingFunction(
"extractTokenAtPosition",
new Dictionary<string, object>
{
{ nameof(delimiter), delimiter },
{ nameof(position), position }
};

return new FieldMappingFunction("extractTokenAtPosition", parameters);
}
[nameof(delimiter)] = delimiter,
[nameof(position)] = position
});

/// <summary>
/// Creates a field mapping function that transforms a string formatted as a JSON array of strings into a string array that can be used to
Expand All @@ -84,9 +123,6 @@ public static FieldMappingFunction ExtractTokenAtPosition(string delimiter, int
/// </para>
/// </remarks>
/// <returns>A new field mapping function.</returns>
public static FieldMappingFunction JsonArrayToStringCollection()
{
return new FieldMappingFunction("jsonArrayToStringCollection");
}
public static FieldMappingFunction JsonArrayToStringCollection() => new FieldMappingFunction("jsonArrayToStringCollection");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace Microsoft.Azure.Search.Models
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common;

/// <summary>
Expand All @@ -15,20 +16,6 @@ namespace Microsoft.Azure.Search.Models
public static class IndexingParametersExtensions
{
private const string ParsingModeKey = "parsingMode";

/// <summary>
/// Specifies that the indexer will index only the storage metadata and completely skip the document extraction process. This is useful when
/// you don't need the document content, nor do you need any of the content type-specific metadata properties.
/// See <see href="https://docs.microsoft.com/azure/search/search-howto-indexing-azure-blob-storage" /> for details.
/// </summary>
/// <param name="parameters">IndexingParameters to configure.</param>
/// <remarks>
/// This option only applies to indexers that index Azure Blob Storage.
/// </remarks>
/// <returns>The IndexingParameters instance.</returns>
[Obsolete("This method is obsolete. Please use SetBlobExtractionMode(BlobExtractionMode.StorageMetadata).")]
public static IndexingParameters IndexStorageMetadataOnly(this IndexingParameters parameters) =>
parameters.SetBlobExtractionMode(BlobExtractionMode.StorageMetadata);

/// <summary>
/// Specifies that the indexer will index only the blobs with the file name extensions you specify. Each string is a file extensions with a
Expand Down Expand Up @@ -80,20 +67,6 @@ public static IndexingParameters ExcludeFileNameExtensions(this IndexingParamete
return parameters;
}

/// <summary>
/// Specifies that the indexer will extract metadata, but skip content extraction for all blobs. If you want to skip content extraction for
/// only some blobs, add AzureSearch_SkipContent metadata to those blobs individually instead of using this option.
/// See <see href="https://docs.microsoft.com/azure/search/search-howto-indexing-azure-blob-storage" /> for details.
/// </summary>
/// <param name="parameters">IndexingParameters to configure.</param>
/// <remarks>
/// This option only applies to indexers that index Azure Blob Storage.
/// </remarks>
/// <returns>The IndexingParameters instance.</returns>
[Obsolete("This method is obsolete. Please use SetBlobExtractionMode(BlobExtractionMode.AllMetadata).")]
public static IndexingParameters SkipContent(this IndexingParameters parameters) =>
parameters.SetBlobExtractionMode(BlobExtractionMode.AllMetadata);

/// <summary>
/// Specifies which parts of a blob will be indexed by the blob storage indexer.
/// </summary>
Expand Down Expand Up @@ -176,16 +149,42 @@ public static IndexingParameters ParseDelimitedTextFiles(this IndexingParameters
return parameters;
}

/// <summary>
/// Tells the indexer to assume that blobs should be parsed as text files in UTF-8 encoding.
/// See <see href="https://docs.microsoft.com/azure/search/search-howto-indexing-azure-blob-storage#indexing-plain-text"/>
/// </summary>
/// <param name="parameters">IndexingParameters to configure.</param>
/// <returns>The IndexingParameters instance.</returns>
public static IndexingParameters ParseText(this IndexingParameters parameters) =>
ParseText(parameters, Encoding.UTF8);

/// <summary>
/// Tells the indexer to assume that blobs should be parsed as text files in the desired encoding.
/// See <see href="https://docs.microsoft.com/azure/search/search-howto-indexing-azure-blob-storage#indexing-plain-text"/>
/// </summary>
/// <param name="parameters">IndexingParameters to configure.</param>
/// <param name="encoding">Encoding used to read the text stored in blobs.</param>
/// <returns>The IndexingParameters instance.</returns>
public static IndexingParameters ParseText(this IndexingParameters parameters, Encoding encoding)
{
Throw.IfArgumentNull(encoding, nameof(encoding));

Configure(parameters, ParsingModeKey, "text");
Configure(parameters, "encoding", encoding.WebName);
return parameters;
}

/// <summary>
/// Specifies that <c cref="BlobExtractionMode.StorageMetadata">BlobExtractionMode.StorageMetadata</c> blob extraction mode will be
/// automatically used for blobs of unsupported content types. The default is false.
/// automatically used for blobs of unsupported content types. This behavior is enabled by default.
/// </summary>
/// <remarks>
/// This option only applies to indexers that index Azure Blob Storage.
/// </remarks>
/// <param name="parameters">IndexingParameters to configure.</param>
/// <returns></returns>
/// <returns>The IndexingParameters instance.</returns>
[Obsolete("This behavior is enabled by default in API version 2016-09-01-Preview and calling this method is no longer necessary")]
public static IndexingParameters DoNotFailOnUnsupportedContentType(this IndexingParameters parameters) =>
Configure(parameters, "failOnUnsupportedContentType", false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ namespace Microsoft.Azure.Search
using Microsoft.Rest.Azure;
using Models;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

/// <summary>
/// Client that can be used to manage and query indexes and documents, as
Expand Down Expand Up @@ -94,5 +98,19 @@ public partial interface ISearchServiceClient : System.IDisposable
/// </summary>
IIndexesOperations Indexes { get; }

/// <summary>
/// Gets service level statistics for an Azure Search service.
/// </summary>
/// <param name='searchRequestOptions'>
/// Additional parameters for the operation
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
Task<AzureOperationResponse<ServiceStatistics>> GetServiceStatisticsWithHttpMessagesAsync(SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public IndexerExecutionResult()
/// <param name="endTime">The end time of this indexer execution, if
/// the execution has already completed.</param>
/// <param name="errors">The item-level indexing errors.</param>
/// <param name="warnings">The item-level indexing warnings.</param>
/// <param name="itemCount">The number of items that were processed
/// during this indexer execution. This includes both successfully
/// processed items and items where indexing was attempted but
Expand All @@ -51,13 +52,14 @@ public IndexerExecutionResult()
/// an indexer execution started.</param>
/// <param name="finalTrackingState">Change tracking state with which
/// an indexer execution finished.</param>
public IndexerExecutionResult(IndexerExecutionStatus status = default(IndexerExecutionStatus), string errorMessage = default(string), System.DateTimeOffset? startTime = default(System.DateTimeOffset?), System.DateTimeOffset? endTime = default(System.DateTimeOffset?), IList<ItemError> errors = default(IList<ItemError>), int itemCount = default(int), int failedItemCount = default(int), string initialTrackingState = default(string), string finalTrackingState = default(string))
public IndexerExecutionResult(IndexerExecutionStatus status = default(IndexerExecutionStatus), string errorMessage = default(string), System.DateTimeOffset? startTime = default(System.DateTimeOffset?), System.DateTimeOffset? endTime = default(System.DateTimeOffset?), IList<ItemError> errors = default(IList<ItemError>), IList<ItemWarning> warnings = default(IList<ItemWarning>), int itemCount = default(int), int failedItemCount = default(int), string initialTrackingState = default(string), string finalTrackingState = default(string))
{
Status = status;
ErrorMessage = errorMessage;
StartTime = startTime;
EndTime = endTime;
Errors = errors;
Warnings = warnings;
ItemCount = itemCount;
FailedItemCount = failedItemCount;
InitialTrackingState = initialTrackingState;
Expand Down Expand Up @@ -102,6 +104,12 @@ public IndexerExecutionResult()
[JsonProperty(PropertyName = "errors")]
public IList<ItemError> Errors { get; private set; }

/// <summary>
/// Gets the item-level indexing warnings.
/// </summary>
[JsonProperty(PropertyName = "warnings")]
public IList<ItemWarning> Warnings { get; private set; }

/// <summary>
/// Gets the number of items that were processed during this indexer
/// execution. This includes both successfully processed items and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public ItemError()
/// <param name="key">The key of the item for which indexing
/// failed.</param>
/// <param name="errorMessage">The message describing the error that
/// occurred while attempting to index the item.</param>
/// occurred while processing the item.</param>
public ItemError(string key = default(string), string errorMessage = default(string))
{
Key = key;
Expand All @@ -53,7 +53,7 @@ public ItemError()

/// <summary>
/// Gets the message describing the error that occurred while
/// attempting to index the item.
/// processing the item.
/// </summary>
[JsonProperty(PropertyName = "errorMessage")]
public string ErrorMessage { get; private set; }
Expand Down
Loading

0 comments on commit 0af3868

Please sign in to comment.