Class AchievementSyncApplyReport
Accumulates the actions and messages an AchievementSyncAssetWriter records applying — or previewing — a sync plan's accepted changes, and renders a readable summary. The pull-side mirror of Serenity.ProjectRecipe.Infrastructure.Editor.Reporting.SerenityRecipeReport: one report shape shared by a dry-run preview and a real apply.
Inherited Members
Namespace: Serenity.Achievements.Application.Sync
Assembly: Serenity.Achievements.Application.dll
Syntax
public sealed class AchievementSyncApplyReport
Constructors
AchievementSyncApplyReport()
Declaration
public AchievementSyncApplyReport()
Properties
Actions
Declaration
public IReadOnlyList<AchievementSyncApplyAction> Actions { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<AchievementSyncApplyAction> | Every action recorded, in the order it was recorded. |
CreatedCount
Declaration
public int CreatedCount { get; }
Property Value
| Type | Description |
|---|---|
| int | How many actions resolved to Created. |
HasBlockers
Declaration
public bool HasBlockers { get; }
Property Value
| Type | Description |
|---|---|
| bool | True when at least one blocker was recorded. |
HasErrors
Declaration
public bool HasErrors { get; }
Property Value
| Type | Description |
|---|---|
| bool | True when at least one error or blocker was recorded. |
Messages
Declaration
public IReadOnlyList<AchievementSyncApplyMessage> Messages { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<AchievementSyncApplyMessage> | Every message recorded, in the order it was recorded. |
SkippedCount
Declaration
public int SkippedCount { get; }
Property Value
| Type | Description |
|---|---|
| int | How many actions resolved to Skipped. |
UpdatedCount
Declaration
public int UpdatedCount { get; }
Property Value
| Type | Description |
|---|---|
| int | How many actions resolved to Updated. |
WasPreviewOnly
Declaration
public bool WasPreviewOnly { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | True when this run only previewed, writing nothing. |
Methods
Absorb(AchievementSyncApplyReport, Func<AchievementSyncApplyAction, bool>)
Takes over what another report recorded, so work done under a scratch report can be kept once it stands.
Declaration
public void Absorb(AchievementSyncApplyReport other, Func<AchievementSyncApplyAction, bool> keepAction)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementSyncApplyReport | other | The report to take from. |
| Func<AchievementSyncApplyAction, bool> | keepAction | Which of its actions come too; null keeps them all. Its messages always come. |
Blocker(string, string)
Records a blocker; nothing is applied for what this blocks.
Declaration
public void Blocker(string apiName, string message)
Parameters
| Type | Name | Description |
|---|---|---|
| string | apiName | |
| string | message |
Count(AchievementSyncApplyOutcome)
Counts actions of a given outcome.
Declaration
public int Count(AchievementSyncApplyOutcome outcome)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementSyncApplyOutcome | outcome |
Returns
| Type | Description |
|---|---|
| int |
Count(AchievementSyncApplySeverity)
Counts messages of a given severity.
Declaration
public int Count(AchievementSyncApplySeverity severity)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementSyncApplySeverity | severity |
Returns
| Type | Description |
|---|---|
| int |
Error(string, string)
Records an error; the related item is skipped but the run continues.
Declaration
public void Error(string apiName, string message)
Parameters
| Type | Name | Description |
|---|---|---|
| string | apiName | |
| string | message |
Info(string, string)
Records an informational message.
Declaration
public void Info(string apiName, string message)
Parameters
| Type | Name | Description |
|---|---|---|
| string | apiName | |
| string | message |
RecordAction(AchievementSyncApplyOutcome, string, string, AchievementSyncApplyTarget, string)
Records one action.
Declaration
public void RecordAction(AchievementSyncApplyOutcome outcome, string apiName, string localId, AchievementSyncApplyTarget target, string detail)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementSyncApplyOutcome | outcome | What the action resolved to. |
| string | apiName | The achievement's platform-side identity key. |
| string | localId | The Serenity achievement id, or empty for a row that did not exist locally yet. |
| AchievementSyncApplyTarget | target | What kind of project data the action wrote, or would write, to. |
| string | detail | A short human-readable description of what changed. |
Summary()
Builds a one-line summary of counts.
Declaration
public string Summary()
Returns
| Type | Description |
|---|---|
| string |
ToConsoleString()
Renders the full report as a multi-line string. Actions are ordered by api name then local id (ordinal) so two reports built from the same content, in any recording order, print identically — the same determinism discipline AchievementSyncPlanner already applies to a plan's own items. Messages are ordered most severe first, then by api name (ordinal).
Declaration
public string ToConsoleString()
Returns
| Type | Description |
|---|---|
| string |
Warning(string, string)
Records a warning.
Declaration
public void Warning(string apiName, string message)
Parameters
| Type | Name | Description |
|---|---|---|
| string | apiName | |
| string | message |