Skip to content
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

Define onlyIfUnchanged parameter for CreateOrUpdate and Delete operations #11420

Merged
merged 7 commits into from
Apr 28, 2020
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
2 changes: 2 additions & 0 deletions sdk/search/Azure.Search.Documents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

- Removed constructor from `SynonymMap` with `IEnumerable<string>` parameter.
- `SearchServiceClient.GetIndexes` and `SearchServiceClient.GetIndexesAsync` now return `Pageable<SearchIndex>` and `AsyncPageable<SearchIndex>` respectively.
- Replaced `MatchConditions` parameters with `bool onlyIfUnchanged` parameters that require a model with an `ETag` property.
- `ETag` properties have been redefined from `string` to `Azure.ETag?` consistent with other packages.

## 1.0.0-preview.2 (2020-04-06)

Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions sdk/search/Azure.Search.Documents/src/Models/DataSource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Azure.Core;

namespace Azure.Search.Documents.Models
{
public partial class DataSource
{
[CodeGenMember("etag")]
private string _etag;

/// <summary>
/// The <see cref="Azure.ETag"/> of the <see cref="DataSource"/>.
/// </summary>
public ETag? ETag
{
get => _etag is null ? (ETag?)null : new ETag(_etag);
set => _etag = value?.ToString();
}
}
}
12 changes: 11 additions & 1 deletion sdk/search/Azure.Search.Documents/src/Models/SearchIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ namespace Azure.Search.Documents.Models
[CodeGenModel("Index")]
public partial class SearchIndex
{
// TODO: Replace constructor and read-only properties when https://github.com/Azure/autorest.csharp/issues/554 is fixed.
[CodeGenMember("etag")]
private string _etag;

/// <summary>
/// Initializes a new instance of the <see cref="SearchIndex"/> class.
Expand Down Expand Up @@ -105,5 +106,14 @@ public SearchIndex(string name, IEnumerable<SearchField> fields)
/// </summary>
[CodeGenMember(Initialize = true, EmptyAsUndefined = true)]
public IList<Tokenizer> Tokenizers { get; }

/// <summary>
/// The <see cref="Azure.ETag"/> of the <see cref="SearchIndex"/>.
/// </summary>
public ETag? ETag
{
get => _etag is null ? (ETag?)null : new ETag(_etag);
set => _etag = value?.ToString();
}
}
}
11 changes: 11 additions & 0 deletions sdk/search/Azure.Search.Documents/src/Models/SearchIndexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,16 @@ namespace Azure.Search.Documents.Models
[CodeGenModel("Indexer")]
public partial class SearchIndexer
{
[CodeGenMember("etag")]
private string _etag;

/// <summary>
/// The <see cref="Azure.ETag"/> of the <see cref="SearchIndexer"/>.
/// </summary>
public ETag? ETag
{
get => _etag is null ? (ETag?)null : new ETag(_etag);
set => _etag = value?.ToString();
}
}
}
22 changes: 22 additions & 0 deletions sdk/search/Azure.Search.Documents/src/Models/Skillset.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Azure.Core;

namespace Azure.Search.Documents.Models
{
public partial class Skillset
{
[CodeGenMember("etag")]
private string _etag;

/// <summary>
/// The <see cref="Azure.ETag"/> of the <see cref="Skillset"/>.
/// </summary>
public ETag? ETag
{
get => _etag is null ? (ETag?)null : new ETag(_etag);
set => _etag = value?.ToString();
}
}
}
12 changes: 12 additions & 0 deletions sdk/search/Azure.Search.Documents/src/Models/SynonymMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public partial class SynonymMap
{
private const string DefaultFormat = "solr";

[CodeGenMember("etag")]
private string _etag;

// TODO: Replace constructor and read-only properties when https://github.com/Azure/autorest.csharp/issues/554 is fixed.

/// <summary>
Expand Down Expand Up @@ -56,6 +59,15 @@ public SynonymMap(string name, TextReader reader)
Synonyms = reader.ReadToEnd();
}

/// <summary>
/// The <see cref="Azure.ETag"/> of the <see cref="SynonymMap"/>.
/// </summary>
public ETag? ETag
{
get => _etag is null ? (ETag?)null : new ETag(_etag);
set => _etag = value?.ToString();
}

/// <summary>
/// Canonicalizes property names from how they appear on <see cref="SynonymMap"/> to those expected by the Search service.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Azure.Search.Documents
{
/// <summary>
/// Options to customize Search service operations conditioned on <see cref="IfMatch"/> or <see cref="IfNoneMatch"/> ETags.
/// </summary>
public class SearchConditionalOptions : SearchRequestOptions
heaths marked this conversation as resolved.
Show resolved Hide resolved
{
/// <summary>
/// Optionally limit requests to resources that have a matching ETag.
/// </summary>
public ETag? IfMatch { get; set; }

/// <summary>
/// Optionally limit requests to resources that do not match the ETag.
/// </summary>
public ETag? IfNoneMatch { get; set; }
}
}
Loading