Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
a16294d
feature(#17): this commit introduces a fluent class for building quer…
https-richardy Apr 24, 2026
fdd81ae
feature(#17): this commit introduces a fluent class for building quer…
https-richardy Apr 24, 2026
ef5035a
feature(#17): this commit introduces a fluent class for building quer…
https-richardy Apr 24, 2026
a3cca01
feature(#17): this commit introduces a fluent class for building quer…
https-richardy Apr 24, 2026
2c3b708
feature(#17): this commit introduces a fluent class for building quer…
https-richardy Apr 24, 2026
33d6a8a
feature(#17): this commit introduces a fluent class for building quer…
https-richardy Apr 24, 2026
a2402bb
feature(#17): this commit introduces a fluent class for building quer…
https-richardy Apr 24, 2026
8b0495c
Revert "feature(#17): this commit introduces a fluent class for build…
https-richardy Apr 24, 2026
a20d0c4
feature(#17) this commit introduces a fluent class for building query…
https-richardy Apr 24, 2026
1da9969
feature(#17): this commit renames the namespace to match the folder name
https-richardy Apr 24, 2026
55990c4
feature(#17): this commit renames the namespace to match the folder name
https-richardy Apr 24, 2026
ef7f8f5
feature(#17): this commit renames the namespace to match the folder name
https-richardy Apr 24, 2026
47ed640
feature(#17): this commit renames the namespace to match the folder name
https-richardy Apr 24, 2026
059ffd9
feature(#17): this commit renames the namespace to match the folder name
https-richardy Apr 24, 2026
54e4e51
feature(#17): this commit renames the namespace to match the folder name
https-richardy Apr 24, 2026
be58053
feature(#17): force a change to detect updates to the SDK package in …
https-richardy Apr 24, 2026
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
77 changes: 77 additions & 0 deletions Packages/Federation.Sdk.Contracts/Source/Filtering/GroupFilters.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
namespace HttpsRichardy.Federation.Sdk.Contracts.Filtering;

public sealed class GroupFilters
{
internal string? Id { get; private set; }
internal string? RealmId { get; private set; }
internal string? Name { get; private set; }

internal bool? IsDeleted { get; private set; }

internal DateOnly? CreatedAfter { get; private set; }
internal DateOnly? CreatedBefore { get; private set; }

public GroupFilters WithIdentifier(string identifier)
{
if (!string.IsNullOrWhiteSpace(identifier))
{
Id = identifier.Trim();
}

return this;
}

public GroupFilters WithRealmId(string realmId)
{
if (!string.IsNullOrWhiteSpace(realmId))
{
RealmId = realmId.Trim();
}

return this;
}

public GroupFilters WithName(string name)
{
if (!string.IsNullOrWhiteSpace(name))
{
Name = name.Trim();
}

return this;
}

public GroupFilters WithIsDeleted(bool? isDeleted)
{
IsDeleted = isDeleted;
return this;
}

public GroupFilters WithCreatedAfter(DateOnly? createdAfter)
{
CreatedAfter = createdAfter;
return this;
}

public GroupFilters WithCreatedBefore(DateOnly? createdBefore)
{
CreatedBefore = createdBefore;
return this;
}

public static GroupsFetchParameters WithoutFilters => new();
public static GroupFilters AsBuilder() => new();

public GroupsFetchParameters Build()
{
return new GroupsFetchParameters
{
Id = Id,
RealmId = RealmId,
Name = Name,
IsDeleted = IsDeleted,
CreatedAfter = CreatedAfter,
CreatedBefore = CreatedBefore
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
namespace HttpsRichardy.Federation.Sdk.Contracts.Filtering;

public sealed class GroupPermissionsFilters
{
internal string? PermissionName { get; private set; }

internal int PageNumber { get; private set; } = 1;
internal int PageSize { get; private set; } = 60;

public GroupPermissionsFilters WithPermissionName(string permissionName)
{
if (!string.IsNullOrWhiteSpace(permissionName))
{
PermissionName = permissionName.Trim();
}

return this;
}

public GroupPermissionsFilters WithPageNumber(int pageNumber)
{
if (pageNumber > 0)
{
PageNumber = pageNumber;
}

return this;
}

public GroupPermissionsFilters WithPageSize(int pageSize)
{
if (pageSize > 0)
{
PageSize = pageSize;
}

return this;
}

public static ListGroupPermissionsParameters WithoutFilters => new();
public static GroupPermissionsFilters AsBuilder() => new();

public ListGroupPermissionsParameters Build()
{
return new ListGroupPermissionsParameters
{
PermissionName = PermissionName,
PageNumber = PageNumber,
PageSize = PageSize
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
namespace HttpsRichardy.Federation.Sdk.Contracts.Filtering;

public sealed class PermissionFilters
{
internal string? Name { get; private set; }
internal bool IncludeDeleted { get; private set; } = false;

internal int PageNumber { get; private set; } = 1;
internal int PageSize { get; private set; } = 20;

public PermissionFilters WithName(string name)
{
if (!string.IsNullOrWhiteSpace(name))
{
Name = name.Trim();
}

return this;
}

public PermissionFilters WithIncludeDeleted(bool includeDeleted)
{
IncludeDeleted = includeDeleted;
return this;
}

public PermissionFilters WithPageNumber(int pageNumber)
{
if (pageNumber > 0)
{
PageNumber = pageNumber;
}

return this;
}

public PermissionFilters WithPageSize(int pageSize)
{
if (pageSize > 0)
{
PageSize = pageSize;
}

return this;
}

public static PermissionsFetchParameters WithoutFilters => new();
public static PermissionFilters AsBuilder() => new();

public PermissionsFetchParameters Build()
{
return new PermissionsFetchParameters
{
Name = Name,
IncludeDeleted = IncludeDeleted,
PageNumber = PageNumber,
PageSize = PageSize
};
}
}
73 changes: 73 additions & 0 deletions Packages/Federation.Sdk.Contracts/Source/Filtering/RealmFilters.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
namespace HttpsRichardy.Federation.Sdk.Contracts.Filtering;

public sealed class RealmFilters
{
internal string? Id { get; private set; }
internal string? Name { get; private set; }

internal bool? IncludeDeleted { get; private set; }

internal int PageNumber { get; private set; } = 1;
internal int PageSize { get; private set; } = 20;

public RealmFilters WithIdentifier(string identifier)
{
if (!string.IsNullOrWhiteSpace(identifier))
{
Id = identifier.Trim();
}

return this;
}

public RealmFilters WithName(string name)
{
if (!string.IsNullOrWhiteSpace(name))
{
Name = name.Trim();
}

return this;
}

public RealmFilters WithIncludeDeleted(bool? includeDeleted)
{
IncludeDeleted = includeDeleted;
return this;
}

public RealmFilters WithPageNumber(int pageNumber)
{
if (pageNumber > 0)
{
PageNumber = pageNumber;
}

return this;
}

public RealmFilters WithPageSize(int pageSize)
{
if (pageSize > 0)
{
PageSize = pageSize;
}

return this;
}

public static RealmFetchParameters WithoutFilters => new();
public static RealmFilters AsBuilder() => new();

public RealmFetchParameters Build()
{
return new RealmFetchParameters
{
Id = Id,
Name = Name,
IncludeDeleted = IncludeDeleted,
PageNumber = PageNumber,
PageSize = PageSize
};
}
}
73 changes: 73 additions & 0 deletions Packages/Federation.Sdk.Contracts/Source/Filtering/UserFilters.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
namespace HttpsRichardy.Federation.Sdk.Contracts.Filtering;

public sealed class UserFilters
{
internal string? Id { get; private set; }
internal string? Username { get; private set; }

internal bool? IsDeleted { get; private set; }

internal int PageNumber { get; private set; } = 1;
internal int PageSize { get; private set; } = 60;

public UserFilters WithIdentifier(string identifier)
{
if (!string.IsNullOrWhiteSpace(identifier))
{
Id = identifier.Trim();
}

return this;
}

public UserFilters WithUsername(string username)
{
if (!string.IsNullOrWhiteSpace(username))
{
Username = username.Trim();
}

return this;
}

public UserFilters WithIsDeleted(bool? isDeleted)
{
IsDeleted = isDeleted;
return this;
}

public UserFilters WithPageNumber(int pageNumber)
{
if (pageNumber > 0)
{
PageNumber = pageNumber;
}

return this;
}

public UserFilters WithPageSize(int pageSize)
{
if (pageSize > 0)
{
PageSize = pageSize;
}

return this;
}

public static UsersFetchParameters WithoutFilters => new();
public static UserFilters AsBuilder() => new();

public UsersFetchParameters Build()
{
return new UsersFetchParameters
{
Id = Id,
Username = Username,
IsDeleted = IsDeleted,
PageNumber = PageNumber,
PageSize = PageSize
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
namespace HttpsRichardy.Federation.Sdk.Contracts.Filtering;

public sealed class UserGroupsFilters
{
internal int PageNumber { get; private set; } = 1;
internal int PageSize { get; private set; } = 60;

public UserGroupsFilters WithPageNumber(int pageNumber)
{
if (pageNumber > 0)
{
PageNumber = pageNumber;
}

return this;
}

public UserGroupsFilters WithPageSize(int pageSize)
{
if (pageSize > 0)
{
PageSize = pageSize;
}

return this;
}

public static ListUserAssignedGroupsParameters WithoutFilters => new();
public static UserGroupsFilters AsBuilder() => new();

public ListUserAssignedGroupsParameters Build()
{
return new ListUserAssignedGroupsParameters
{
PageNumber = PageNumber,
PageSize = PageSize
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public static string ToQueryString<TParameters>(TParameters instance)
foreach (var property in properties)
{
var value = property.GetValue(instance);
if (value is null) continue;
if (value is null)
continue;

string name = ToCamelCase(property.Name);
string stringValue = value switch
Expand Down
Loading