Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected static T Lookup(string name)
/// Compares the ExtensibleEnum for equality with another ExtensibleEnum.
/// </summary>
/// <param name="other">The ExtensibleEnum with which to compare.</param>
/// <returns>true if the ExtensibleEnum objects are equal; false otherwise.</returns>
/// <returns><c>true</c> if the ExtensibleEnum objects are equal; otherwise, <c>false</c>.</returns>
public bool Equals(T other)
{
if (object.ReferenceEquals(other, null))
Expand All @@ -81,13 +81,20 @@ public bool Equals(T other)
return this._name == other._name;
}

/// <inheritdoc />
/// <summary>
/// Determines whether the specified object is equal to the current object.
/// </summary>
/// <param name="obj">The object to compare with the current object.</param>
/// <returns><c>true</c> if the specified object is equal to the current object; otherwise, <c>false</c>.</returns>
public override bool Equals(object obj)
{
return this.Equals(obj as T);
}

/// <inheritdoc />
/// <summary>
/// Serves as the default hash function.
/// </summary>
/// <returns>A hash code for the current object.</returns>
public override int GetHashCode()
{
return _name.GetHashCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ namespace Microsoft.Azure.Search
/// Credentials used to authenticate to an Azure Search service.
/// <see href="https://docs.microsoft.com/rest/api/searchservice/"/>
/// </summary>
/// <remarks>
/// See <see href="https://docs.microsoft.com/azure/search/search-security-api-keys"/> for more information about API keys in Azure Search.
/// </remarks>
public class SearchCredentials : ServiceClientCredentials
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ namespace Microsoft.Azure.Search
public partial interface ISearchIndexClient
{
/// <summary>
/// Gets the credentials used to authenticate to an Azure Search service.
/// Gets the credentials used to authenticate to an Azure Search service. This can be either a query API key or an admin API key.
/// </summary>
/// <remarks>
/// See <see href="https://docs.microsoft.com/azure/search/search-security-api-keys"/> for more information about API keys in Azure Search.
/// </remarks>
SearchCredentials SearchCredentials { get; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,25 @@ public SearchIndexClient(
Initialize(searchServiceName, indexName, credentials);
}

/// <inheritdoc />
/// <summary>
/// Gets the credentials used to authenticate to an Azure Search service. This can be either a query API key or an admin API key.
/// </summary>
/// <remarks>
/// See <see href="https://docs.microsoft.com/azure/search/search-security-api-keys"/> for more information about API keys in Azure Search.
/// </remarks>
public SearchCredentials SearchCredentials => (SearchCredentials)Credentials;

/// <inheritdoc />
/// <summary>
/// Indicates whether the index client should use HTTP GET for making Search and Suggest requests to the
/// Azure Search REST API. The default is <c>false</c>, which indicates that HTTP POST will be used.
/// </summary>
public bool UseHttpGetForQueries { get; set; }

/// <inheritdoc />
/// <summary>
/// Changes the BaseUri of this client to target a different index in the same Azure Search service. This method is NOT thread-safe; You
/// must guarantee that no other threads are using the client before calling it.
/// </summary>
/// <param name="newIndexName">The name of the index to which all subsequent requests should be sent.</param>
[Obsolete("This method is deprecated. Please set the IndexName property instead.")]
public void TargetDifferentIndex(string newIndexName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,76 @@ namespace Microsoft.Azure.Search

internal partial class DataSourcesOperations
{
/// <inheritdoc />
/// <summary>
/// Creates a new Azure Search datasource or updates a datasource if it already
/// exists.
/// <see href="https://docs.microsoft.com/rest/api/searchservice/Update-Data-Source" />
/// </summary>
/// <param name='dataSource'>
/// The definition of the datasource to create or update.
/// </param>
/// <param name='searchRequestOptions'>
/// Additional parameters for the operation.
/// </param>
/// <param name='accessCondition'>
/// Additional parameters for the operation.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing 'returns' tag

/// The cancellation token.
/// </param>
/// <exception cref="CloudException">
/// Thrown when the operation returned an invalid status code.
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response.
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null.
/// </exception>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null.
/// </exception>
/// <returns>
/// A response object containing the response body and response headers.
/// </returns>
public Task<AzureOperationResponse<DataSource>> CreateOrUpdateWithHttpMessagesAsync(DataSource dataSource, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), AccessCondition accessCondition = default(AccessCondition), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
return CreateOrUpdateWithHttpMessagesAsync(dataSource?.Name, dataSource, searchRequestOptions, accessCondition, customHeaders, cancellationToken);
}

/// <inheritdoc />
/// <summary>
/// Determines whether or not the given data source exists in the Azure Search service.
/// </summary>
/// <param name="dataSourceName">
/// The name of the data source.
/// </param>
/// <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>
/// <exception cref="CloudException">
/// Thrown when the operation returned an invalid status code.
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response.
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null.
/// </exception>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null.
/// </exception>
/// <returns>
/// A response with the value <c>true</c> if the data source exists; <c>false</c> otherwise.
/// </returns>
public Task<AzureOperationResponse<bool>> ExistsWithHttpMessagesAsync(
string dataSourceName,
SearchRequestOptions searchRequestOptions = default(SearchRequestOptions),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ namespace Microsoft.Azure.Search
public static partial class DataSourcesOperationsExtensions
{
/// <summary>
/// Creates a new Azure Search datasource or updates a datasource if it
/// already exists.
/// Creates a new Azure Search datasource or updates a datasource if it already
/// exists.
/// <see href="https://docs.microsoft.com/rest/api/searchservice/Update-Data-Source" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
Expand All @@ -26,19 +27,23 @@ public static partial class DataSourcesOperationsExtensions
/// The definition of the datasource to create or update.
/// </param>
/// <param name='searchRequestOptions'>
/// Additional parameters for the operation
/// Additional parameters for the operation.
/// </param>
/// <param name='accessCondition'>
/// Additional parameters for the operation
/// Additional parameters for the operation.
/// </param>
/// <returns>
/// The datasource that was created or updated.
/// </returns>
public static DataSource CreateOrUpdate(this IDataSourcesOperations operations, DataSource dataSource, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), AccessCondition accessCondition = default(AccessCondition))
{
return operations.CreateOrUpdateAsync(dataSource, searchRequestOptions, accessCondition).GetAwaiter().GetResult();
}

/// <summary>
/// Creates a new Azure Search datasource or updates a datasource if it
/// already exists.
/// Creates a new Azure Search datasource or updates a datasource if it already
/// exists.
/// <see href="https://docs.microsoft.com/rest/api/searchservice/Update-Data-Source" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
Expand All @@ -55,6 +60,9 @@ public static partial class DataSourcesOperationsExtensions
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <returns>
/// The datasource that was created or updated.
/// </returns>
public static async Task<DataSource> CreateOrUpdateAsync(this IDataSourcesOperations operations, DataSource dataSource, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), AccessCondition accessCondition = default(AccessCondition), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(dataSource, searchRequestOptions, accessCondition, null, cancellationToken).ConfigureAwait(false))
Expand All @@ -73,7 +81,7 @@ public static partial class DataSourcesOperationsExtensions
/// The name of the data source.
/// </param>
/// <param name='searchRequestOptions'>
/// Additional parameters for the operation
/// Additional parameters for the operation.
/// </param>
/// <returns>
/// <c>true</c> if the data source exists; <c>false</c> otherwise.
Expand All @@ -96,7 +104,7 @@ public static bool Exists(
/// The name of the data source.
/// </param>
/// <param name='searchRequestOptions'>
/// Additional parameters for the operation
/// Additional parameters for the operation.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,40 @@ namespace Microsoft.Azure.Search
public partial interface IDataSourcesOperations
{
/// <summary>
/// Creates a new Azure Search datasource or updates a datasource if
/// it already exists.
/// Creates a new Azure Search datasource or updates a datasource if it already
/// exists.
/// <see href="https://docs.microsoft.com/rest/api/searchservice/Update-Data-Source" />
/// </summary>
/// <param name='dataSource'>
/// The definition of the datasource to create or update.
/// </param>
/// <param name='searchRequestOptions'>
/// Additional parameters for the operation
/// Additional parameters for the operation.
/// </param>
/// <param name='accessCondition'>
/// Additional parameters for the operation
/// Additional parameters for the operation.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// Headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="CloudException">
/// Thrown when the operation returned an invalid status code.
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response.
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null.
/// </exception>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null.
/// </exception>
/// <returns>
/// A response object containing the response body and response headers.
/// </returns>
Task<AzureOperationResponse<DataSource>> CreateOrUpdateWithHttpMessagesAsync(DataSource dataSource, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), AccessCondition accessCondition = default(AccessCondition), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
Expand All @@ -40,14 +56,26 @@ public partial interface IDataSourcesOperations
/// The name of the data source.
/// </param>
/// <param name='searchRequestOptions'>
/// Additional parameters for the operation
/// 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>
/// <exception cref="CloudException">
/// Thrown when the operation returned an invalid status code.
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response.
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null.
/// </exception>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null.
/// </exception>
/// <returns>
/// A response with the value <c>true</c> if the data source exists; <c>false</c> otherwise.
/// </returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ namespace Microsoft.Azure.Search
public partial interface ISearchServiceClient
{
/// <summary>
/// Gets the credentials used to authenticate to an Azure Search service.
/// Gets the credentials used to authenticate to an Azure Search service. This can be either a query API key or an admin API key.
/// </summary>
/// <remarks>
/// See <see href="https://docs.microsoft.com/azure/search/search-security-api-keys"/> for more information about API keys in Azure Search.
/// </remarks>
SearchCredentials SearchCredentials { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ namespace Microsoft.Azure.Search
public partial interface IIndexersOperations
{
/// <summary>
/// Creates a new Azure Search indexer or updates an indexer if it
/// already exists.
/// Creates a new Azure Search indexer or updates an indexer if it already
/// exists.
/// <see href="https://docs.microsoft.com/rest/api/searchservice/Create-Indexer" />
/// </summary>
/// <param name='indexer'>
/// The definition of the indexer to create or update.
Expand All @@ -26,11 +27,26 @@ public partial interface IIndexersOperations
/// Additional parameters for the operation
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// Headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="CloudException">
/// Thrown when the operation returned an invalid status code.
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response.
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null.
/// </exception>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null.
/// </exception>
/// <returns>
/// A response object containing the response body and response headers.
/// </returns>
Task<AzureOperationResponse<Indexer>> CreateOrUpdateWithHttpMessagesAsync(Indexer indexer, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), AccessCondition accessCondition = default(AccessCondition), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
Expand All @@ -40,14 +56,26 @@ public partial interface IIndexersOperations
/// The name of the indexer.
/// </param>
/// <param name='searchRequestOptions'>
/// Additional parameters for the operation
/// 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>
/// <exception cref="CloudException">
/// Thrown when the operation returned an invalid status code.
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response.
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null.
/// </exception>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null.
/// </exception>
/// <returns>
/// A response with the value <c>true</c> if the indexer exists; <c>false</c> otherwise.
/// </returns>
Expand Down
Loading