Skip to content
Merged
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
21 changes: 21 additions & 0 deletions src/Models/ReactionOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ private enum OpType
private readonly List<OpType> _ops;
private readonly List<string> _kindFilters;

private string _userId;
private string _childrenUserId;

private ReactionOption()
{
_ops = new List<OpType>();
Expand All @@ -45,6 +48,12 @@ internal void Apply(RestRequest request)

if (_kindFilters.Count != 0)
request.AddQueryParameter("reactionKindsFilter", string.Join(",", _kindFilters));

if (!string.IsNullOrWhiteSpace(_userId))
request.AddQueryParameter("filter_user_id", _userId);

if (!string.IsNullOrWhiteSpace(_childrenUserId))
request.AddQueryParameter("children_user_id", _userId);
}

public static ReactionOption With()
Expand Down Expand Up @@ -87,5 +96,17 @@ public ReactionOption KindFilter(string value)
_kindFilters.Add(value);
return this;
}

public ReactionOption UserFilter(string value)
{
_userId = value;
Copy link
Contributor

Choose a reason for hiding this comment

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

[dotnet] reported by reviewdog 🐶
error CS0191: A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer) [/home/runner/work/stream-net/stream-net/src/stream-net.csproj]

return this;
}

public ReactionOption ChildrenUserFilter(string value)
{
_childrenUserId = value;
Copy link
Contributor

Choose a reason for hiding this comment

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

[dotnet] reported by reviewdog 🐶
error CS0191: A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer) [/home/runner/work/stream-net/stream-net/src/stream-net.csproj]

return this;
}
}
}