Skip to content

Commit 7c05a11

Browse files
committed
Split FilterOptions off of PageOptions
Enable filtering lists of resources that do not support paging
1 parent 3b0f70c commit 7c05a11

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/corelib/PageOptions.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace OpenStack
66
/// <summary>
77
/// Paging options when listing a resource that supports paging.
88
/// </summary>
9-
public class PageOptions : IQueryStringBuilder
9+
public class PageOptions : FilterOptions
1010
{
1111
/// <summary>
1212
/// The number of resources to return per page.
@@ -19,16 +19,25 @@ public class PageOptions : IQueryStringBuilder
1919
public Identifier StartingAt { get; set; }
2020

2121
/// <summary />
22-
protected virtual IDictionary<string, object> BuildQueryString()
22+
protected override IDictionary<string, object> BuildQueryString()
2323
{
2424
return new Dictionary<string, object>
2525
{
2626
{"marker", StartingAt},
2727
{"limit", PageSize}
2828
};
2929
}
30+
}
31+
32+
/// <summary>
33+
/// Options when list a resource that supports filtering.
34+
/// </summary>
35+
public abstract class FilterOptions : IQueryStringBuilder
36+
{
37+
/// <summary />
38+
protected abstract IDictionary<string, object> BuildQueryString();
3039

31-
IDictionary<string , object> IQueryStringBuilder.Build()
40+
IDictionary<string, object> IQueryStringBuilder.Build()
3241
{
3342
return BuildQueryString();
3443
}

0 commit comments

Comments
 (0)