|
| 1 | +// Copyright (c) Barry Dorrans. All rights reserved. |
| 2 | +// Licensed under the MIT License. |
| 3 | + |
| 4 | +using System.Diagnostics.CodeAnalysis; |
| 5 | +using System.Text.Json.Serialization; |
| 6 | + |
| 7 | +namespace idunno.AtProto.Labels |
| 8 | +{ |
| 9 | + /// <summary> |
| 10 | + /// Encapsulates a label value and its expected interpretations and behaviors. |
| 11 | + /// </summary> |
| 12 | + public sealed record LabelValueDefinition |
| 13 | + { |
| 14 | + /// <summary> |
| 15 | + /// Gets the identifer of the label |
| 16 | + /// </summary> |
| 17 | + public required string Identifier { get; init; } |
| 18 | + |
| 19 | + /// <summary> |
| 20 | + /// Gets an indication of how a client visually convey this label. |
| 21 | + /// |
| 22 | + /// 'inform' means neutral and informational; |
| 23 | + /// 'alert' means negative and warning; |
| 24 | + /// 'none' means show nothing. |
| 25 | + /// |
| 26 | + /// Other values may occur. |
| 27 | + /// </summary> |
| 28 | + public required string Severity { get; init; } |
| 29 | + |
| 30 | + /// <summary> |
| 31 | + /// Gets an indication of how a client should hide entities who have the the label applied. |
| 32 | + /// |
| 33 | + /// 'inform' means neutral and informational; |
| 34 | + /// |
| 35 | + /// 'alert' means negative and warning; |
| 36 | + /// |
| 37 | + /// 'none' means show nothing. |
| 38 | + /// |
| 39 | + /// Other values may occur. |
| 40 | + /// </summary> |
| 41 | + public required string Blurs { get; init; } |
| 42 | + |
| 43 | + /// <summary> |
| 44 | + /// Gets the default setting for the label, if any. |
| 45 | + /// </summary> |
| 46 | + public string DefaultSetting { get; init; } = "warn"; |
| 47 | + |
| 48 | + /// <summary> |
| 49 | + /// Gets a flag indicating if the user needs to have adult content enabled to configure the label. |
| 50 | + /// </summary> |
| 51 | + public bool AdultOnly { get; init; } |
| 52 | + |
| 53 | + /// <summary> |
| 54 | + /// A collection of strings which describe the label in the UI, localized into a specific language. |
| 55 | + /// </summary> |
| 56 | + public ICollection<LabelValueDefinitionStrings> Locales { get; init; } = []; |
| 57 | + } |
| 58 | + |
| 59 | + |
| 60 | + /// <summary> |
| 61 | + /// Strings which describe the label in the UI, localized into a specific language. |
| 62 | + /// </summary> |
| 63 | + public sealed record LabelValueDefinitionStrings |
| 64 | + { |
| 65 | + /// <summary> |
| 66 | + /// Gets the code of the language these strings are written in. |
| 67 | + /// </summary> |
| 68 | + public required string Lang { get; init; } |
| 69 | + |
| 70 | + /// <summary> |
| 71 | + /// Gets a short human-readable name for the label. |
| 72 | + /// </summary> |
| 73 | + public required string Name { get; init; } |
| 74 | + |
| 75 | + /// <summary> |
| 76 | + /// Gets a longer description of what the label means and why it might be applied. |
| 77 | + /// </summary> |
| 78 | + public required string Description { get; init; } |
| 79 | + } |
| 80 | +} |
0 commit comments