-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: change ListIndexesAsync return to a list of IndexInfo (#515)
Change the data that ListIndexesAsync returns from a list of index names to a list of IndexInfo object containing the names. We will add more fields in the future.
- Loading branch information
Showing
4 changed files
with
51 additions
and
9 deletions.
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
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,39 @@ | ||
namespace Momento.Sdk.Responses.Vector; | ||
|
||
/// <summary> | ||
/// Information about a vector index. | ||
/// </summary> | ||
public class IndexInfo | ||
{ | ||
/// <summary> | ||
/// The name of the index. | ||
/// </summary> | ||
public string Name { get; } | ||
|
||
/// <summary> | ||
/// Constructs an IndexInfo. | ||
/// </summary> | ||
/// <param name="name">The name of the index.</param> | ||
public IndexInfo(string name) | ||
{ | ||
Name = name; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override bool Equals(object obj) | ||
{ | ||
return obj is IndexInfo other && Name == other.Name; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override int GetHashCode() | ||
{ | ||
return Name.GetHashCode(); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override string ToString() | ||
{ | ||
return $"IndexInfo {{ Name = {Name} }}"; | ||
} | ||
} |
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