Skip to content

Commit

Permalink
Added missing inline docs for client project
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko committed Feb 17, 2024
1 parent e71430a commit d6beea7
Show file tree
Hide file tree
Showing 68 changed files with 1,121 additions and 149 deletions.
82 changes: 82 additions & 0 deletions src/ReportPortal.Client/Abstractions/Filtering/Filter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,114 @@

namespace ReportPortal.Client.Abstractions.Filtering
{
/// <summary>
/// Represents the available filter operations.
/// </summary>
public enum FilterOperation
{
/// <summary>
/// Represents the "eq" filter operation, which checks for equality.
/// </summary>
[JsonPropertyName("eq")]
Equals,

/// <summary>
/// Represents the "ne" filter operation, which checks for inequality.
/// </summary>
[JsonPropertyName("ne")]
NotEquals,

/// <summary>
/// Represents the "cnt" filter operation, which checks if a value contains a specified substring.
/// </summary>
[JsonPropertyName("cnt")]
Contains,

/// <summary>
/// Represents the "!cnt" filter operation, which checks if a value does not contain a specified substring.
/// </summary>
[JsonPropertyName("!cnt")]
NotContains,

/// <summary>
/// Represents the "ex" filter operation, which checks if a value exists.
/// </summary>
[JsonPropertyName("ex")]
Exists,

/// <summary>
/// Represents the "in" filter operation, which checks if a value is in a specified list.
/// </summary>
[JsonPropertyName("in")]
In,

/// <summary>
/// Represents the "!in" filter operation, which checks if a value is not in a specified list.
/// </summary>
[JsonPropertyName("!in")]
NotIn,

/// <summary>
/// Represents the "gt" filter operation, which checks if a value is greater than a specified value.
/// </summary>
[JsonPropertyName("gt")]
GreaterThan,

/// <summary>
/// Represents the "gte" filter operation, which checks if a value is greater than or equal to a specified value.
/// </summary>
[JsonPropertyName("gte")]
GreaterThanOrEquals,

/// <summary>
/// Represents the "lt" filter operation, which checks if a value is lower than a specified value.
/// </summary>
[JsonPropertyName("lt")]
LowerThan,

/// <summary>
/// Represents the "lte" filter operation, which checks if a value is lower than or equal to a specified value.
/// </summary>
[JsonPropertyName("lte")]
LowerThanOrEquals,

/// <summary>
/// Represents the "btw" filter operation, which checks if a value is between two specified values.
/// </summary>
[JsonPropertyName("btw")]
Between,

/// <summary>
/// Represents the "size" filter operation, which checks if the size of a value meets a specified condition.
/// </summary>
[JsonPropertyName("size")]
Size,

/// <summary>
/// Represents the "has" filter operation, which checks if a value has a specified property.
/// </summary>
[JsonPropertyName("has")]
Has,

/// <summary>
/// Represents the "!has" filter operation, which checks if a value does not have a specified property.
/// </summary>
[JsonPropertyName("!has")]
NotHas
}

/// <summary>
/// Represents a filter used for querying data.
/// </summary>
public class Filter
{
/// <summary>
/// Initializes a new instance of the <see cref="Filter"/> class.
/// </summary>
/// <param name="operation">The filter operation.</param>
/// <param name="field">The field to filter on.</param>
/// <param name="value">The value to filter by.</param>
/// <param name="values">Additional values to filter by.</param>
public Filter(FilterOperation operation, string field, object value, params object[] values)
{
Operation = operation;
Expand All @@ -46,10 +119,19 @@ public Filter(FilterOperation operation, string field, object value, params obje
Values.AddRange(values);
}

/// <summary>
/// Gets or sets the filter operation.
/// </summary>
public FilterOperation Operation { get; set; }

/// <summary>
/// Gets or sets the field to filter on.
/// </summary>
public string Field { get; set; }

/// <summary>
/// Gets or sets the values to filter by.
/// </summary>
public List<object> Values { get; set; }
}
}
18 changes: 17 additions & 1 deletion src/ReportPortal.Client/Abstractions/Filtering/FilterOption.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
using ReportPortal.Client.Extentions;
using ReportPortal.Client.Extensions;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

namespace ReportPortal.Client.Abstractions.Filtering
{
/// <summary>
/// Represents a filter option for querying data.
/// </summary>
public class FilterOption
{
/// <summary>
/// Gets or sets the paging options.
/// </summary>
public Paging Paging { get; set; }

/// <summary>
/// Gets or sets the sorting options.
/// </summary>
public Sorting Sorting { get; set; }

/// <summary>
/// Gets or sets the list of filters.
/// </summary>
public List<Filter> Filters { get; set; }

/// <summary>
/// Converts the filter option to a string representation.
/// </summary>
/// <returns>A string representation of the filter option.</returns>
public override string ToString()
{
var builder = new StringBuilder();
Expand Down
14 changes: 14 additions & 0 deletions src/ReportPortal.Client/Abstractions/Filtering/Paging.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
namespace ReportPortal.Client.Abstractions.Filtering
{
/// <summary>
/// Represents the paging information for a collection of items.
/// </summary>
public class Paging
{
/// <summary>
/// Initializes a new instance of the <see cref="Paging"/> class with the specified number and size.
/// </summary>
/// <param name="number">The page number.</param>
/// <param name="size">The number of items per page.</param>
public Paging(int number, int size)
{
Number = number;
Size = size;
}

/// <summary>
/// Gets or sets the page number.
/// </summary>
public int Number { get; set; }

/// <summary>
/// Gets or sets the number of items per page.
/// </summary>
public int Size { get; set; }
}
}
26 changes: 26 additions & 0 deletions src/ReportPortal.Client/Abstractions/Filtering/Sorting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,48 @@

namespace ReportPortal.Client.Abstractions.Filtering
{
/// <summary>
/// Represents the sort direction.
/// </summary>
public enum SortDirection
{
/// <summary>
/// Represents the ascending sort direction.
/// </summary>
[JsonPropertyName("ASC")]
Ascending,

/// <summary>
/// Represents the descending sort direction.
/// </summary>
[JsonPropertyName("DESC")]
Descending
}

/// <summary>
/// Represents the sorting criteria.
/// </summary>
public class Sorting
{
/// <summary>
/// Initializes a new instance of the <see cref="Sorting"/> class with the specified fields and direction.
/// </summary>
/// <param name="byFields">The list of fields to sort by.</param>
/// <param name="direction">The sort direction.</param>
public Sorting(List<string> byFields, SortDirection direction = SortDirection.Ascending)
{
Fields = byFields;
Direction = direction;
}

/// <summary>
/// Gets or sets the list of fields to sort by.
/// </summary>
public List<string> Fields { get; set; }

/// <summary>
/// Gets or sets the sort direction.
/// </summary>
public SortDirection Direction { get; set; }
}
}
29 changes: 28 additions & 1 deletion src/ReportPortal.Client/Abstractions/IClientService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,49 @@ namespace ReportPortal.Client.Abstractions
/// </summary>
public interface IClientService
{
/// <summary>
/// Gets the resource for managing launches.
/// </summary>
ILaunchResource Launch { get; }

/// <summary>
/// Gets the resource for managing asynchronous launches.
/// </summary>
IAsyncLaunchResource AsyncLaunch { get; }

/// <summary>
/// Gets the resource for managing test items.
/// </summary>
ITestItemResource TestItem { get; }

/// <summary>
/// Gets the resource for managing asynchronous test items.
/// </summary>
IAsyncTestItemResource AsyncTestItem { get; }

/// <summary>
/// Gets the resource for managing log items.
/// </summary>
ILogItemResource LogItem { get; }

/// <summary>
/// Gets the resource for managing asynchronous log items.
/// </summary>
IAsyncLogItemResource AsyncLogItem { get; }

/// <summary>
/// Gets the resource for managing users.
/// </summary>
IUserResource User { get; }

/// <summary>
/// Gets the resource for managing user filters.
/// </summary>
IUserFilterResource UserFilter { get; }

/// <summary>
/// Gets the resource for managing projects.
/// </summary>
IProjectResource Project { get; }
}
}
}
14 changes: 14 additions & 0 deletions src/ReportPortal.Client/Abstractions/Models/AnalyzerItemsMode.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
namespace ReportPortal.Client.Abstractions.Models
{
/// <summary>
/// Represents the mode of analyzer items.
/// </summary>
public class AnalyzerItemsMode
{
/// <summary>
/// Represents the "To Investigate" mode of analyzer items.
/// </summary>
public const string ToInvestigate = "TO_INVESTIGATE";

/// <summary>
/// Represents the "Auto Analyzed" mode of analyzer items.
/// </summary>
public const string AutoAnalyzed = "AUTO_ANALYZED";

/// <summary>
/// Represents the "Manually Analyzed" mode of analyzer items.
/// </summary>
public const string ManuallyAnalyzed = "MANUALLY_ANALYZED";
}
}
14 changes: 14 additions & 0 deletions src/ReportPortal.Client/Abstractions/Models/AnalyzerMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@

namespace ReportPortal.Client.Abstractions.Models
{
/// <summary>
/// Represents the mode of the analyzer.
/// </summary>
public enum AnalyzerMode
{
/// <summary>
/// Analyzes all launches.
/// </summary>
[JsonPropertyName("ALL")]
All,

/// <summary>
/// Analyzes the current launch.
/// </summary>
[JsonPropertyName("CURRENT_LAUNCH")]
CurrentLaunch,

/// <summary>
/// Analyzes launches by launch name.
/// </summary>
[JsonPropertyName("LAUNCH_NAME")]
LaunchName
}
Expand Down
12 changes: 12 additions & 0 deletions src/ReportPortal.Client/Abstractions/Models/ItemAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@

namespace ReportPortal.Client.Abstractions.Models
{
/// <summary>
/// Represents an attribute of an item.
/// </summary>
public class ItemAttribute
{
/// <summary>
/// Gets or sets the key of the attribute.
/// </summary>
public string Key { get; set; }

/// <summary>
/// Gets or sets the value of the attribute.
/// </summary>
public string Value { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the attribute is a system attribute.
/// </summary>
[JsonPropertyName("system")]
public bool IsSystem { get; set; }
}
Expand Down
7 changes: 7 additions & 0 deletions src/ReportPortal.Client/Abstractions/Models/LaunchMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@ namespace ReportPortal.Client.Abstractions.Models
/// </summary>
public enum LaunchMode
{
/// <summary>
/// The default launch mode.
/// </summary>
[JsonPropertyName("DEFAULT")]
Default,

/// <summary>
/// The debug launch mode.
/// </summary>
[JsonPropertyName("DEBUG")]
Debug
}
Expand Down
Loading

0 comments on commit d6beea7

Please sign in to comment.