-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Azure Search] Upgrade data plane to latest AutoRest and split into 4 packages #4104
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9c641bf
[Azure Search] Upgrade data plane to the latest version of AutoRest
brjohnstmsft 503e14f
[Azure Search] Splitting the data plane into four packages
brjohnstmsft a04d88b
[Azure Search] Factoring out data plane assembly and package versions
brjohnstmsft f7ee80a
[Azure Search] Replacing ConverterBase with JsonReader extension methods
brjohnstmsft 7e51a54
[Azure Search] Fixing issue with copying JsonSerializerSettings
brjohnstmsft 623e1f0
[Azure Search] Versioning each data plane package separately
brjohnstmsft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for | ||
// license information. | ||
|
||
using System.Reflection; | ||
using System.Resources; | ||
|
||
[assembly: AssemblyVersion("5.0.0.0")] | ||
[assembly: AssemblyFileVersion("5.0.0.0")] | ||
|
||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Microsoft")] | ||
[assembly: AssemblyProduct("Microsoft Azure .NET SDK")] | ||
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
[assembly: NeutralResourcesLanguage("en")] |
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,10 @@ | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<PackageTags>Microsoft Azure Search;Search</PackageTags> | ||
<VersionPrefix>5.0.0-preview</VersionPrefix> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net452;netstandard1.4</TargetFrameworks> | ||
</PropertyGroup> | ||
</Project> |
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
34 changes: 34 additions & 0 deletions
34
...aPlane/Microsoft.Azure.Search.Common/Customizations/Search/Common/EnumerableExtensions.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,34 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for | ||
// license information. | ||
|
||
namespace Microsoft.Azure.Search.Common | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
/// <summary> | ||
/// Defines extension methods for IEnumerable that are used in the implementation of the Azure Search | ||
/// .NET SDK. | ||
/// </summary> | ||
public static class EnumerableExtensions | ||
{ | ||
/// <summary> | ||
/// Converts the elements of a collection to strings and concatenates them into a comma-separated list, | ||
/// or returns null for null or empty collections. | ||
/// </summary> | ||
/// <typeparam name="T">The type of elements that will be converted to strings.</typeparam> | ||
/// <param name="enumerable">The collection to turn into a comma-separated string.</param> | ||
/// <returns>A comma-separated string, or null if enumerable is null or empty.</returns> | ||
public static string ToCommaSeparatedString<T>(this IEnumerable<T> enumerable) | ||
{ | ||
if (enumerable == null || !enumerable.Any()) | ||
{ | ||
return null; | ||
} | ||
|
||
return String.Join(",", enumerable); | ||
} | ||
} | ||
} |
85 changes: 85 additions & 0 deletions
85
...SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Common/Throw.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,85 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for | ||
// license information. | ||
|
||
namespace Microsoft.Azure.Search.Common | ||
{ | ||
using System; | ||
|
||
/// <summary> | ||
/// Defines utility methods for validating arguments. | ||
/// </summary> | ||
public static class Throw | ||
{ | ||
/// <summary> | ||
/// Throws ArgumentException with the given parameter name and optional message if the given Boolean | ||
/// value is true. | ||
/// </summary> | ||
/// <param name="isInvalid">The flag to test. This method throws if it's true and does nothing if | ||
/// it's false.</param> | ||
/// <param name="paramName">The name of the parameter being validated. This is passed to the | ||
/// ArgumentException constructor.</param> | ||
/// <param name="message">An optional error message to include in the ArgumentException. The default | ||
/// message is "Invalid argument."</param> | ||
public static void IfArgument(bool isInvalid, string paramName, string message = null) | ||
{ | ||
if (isInvalid) | ||
{ | ||
message = message ?? "Invalid argument."; | ||
throw new ArgumentException(message, paramName); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Throws ArgumentNullException with the given parameter name and optional message if the given | ||
/// reference is null. | ||
/// </summary> | ||
/// <typeparam name="T">The type of value to test. Must be a reference type.</typeparam> | ||
/// <param name="value">The reference to test for null.</param> | ||
/// <param name="paramName">The name of the parameter being validated. This is passed to the | ||
/// ArgumentNullException constructor.</param> | ||
/// <param name="message">An optional error message to include in the ArgumentNullException.</param> | ||
public static void IfArgumentNull<T>(T value, string paramName, string message = null) where T : class | ||
{ | ||
if (value == null) | ||
{ | ||
if (message == null) | ||
{ | ||
throw new ArgumentNullException(paramName); | ||
} | ||
else | ||
{ | ||
throw new ArgumentNullException(paramName, message); | ||
} | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Throws ArgumentNullException or ArgumentException with the given parameter name and optional message | ||
/// if the given string is null or empty, respectively. | ||
/// </summary> | ||
/// <param name="value">The string to test for null or empty.</param> | ||
/// <param name="paramName">The name of the parameter being validated. This is passed to the | ||
/// ArgumentNullException or ArgumentException constructor.</param> | ||
/// <param name="message">An optional error message to include in the ArgumentNullException | ||
/// or ArgumentException.</param> | ||
public static void IfArgumentNullOrEmpty(string value, string paramName, string message = null) | ||
{ | ||
IfArgumentNull(value, paramName, message); | ||
|
||
message = message ?? "Argument cannot be an empty string."; | ||
IfArgument(value.Length == 0, paramName, message); | ||
} | ||
|
||
/// <summary> | ||
/// Throws ArgumentNullException or ArgumentException with a pre-determined message if the given search | ||
/// service name is null or empty, respectively. | ||
/// </summary> | ||
/// <param name="searchServiceName">The search service name to validate.</param> | ||
public static void IfNullOrEmptySearchServiceName(string searchServiceName) => | ||
IfArgumentNullOrEmpty( | ||
searchServiceName, | ||
nameof(searchServiceName), | ||
"Invalid search service name. Name cannot be null or an empty string."); | ||
} | ||
} |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brjohnstmsft looks like the bug has been fixed that allows you specify Fx Version common for projects.
In that case, we will apply target Fx version from a common file and at that point, this line will be deleted from here (of course you will be involved in the PR), just as an FYI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!