-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathParameterExampleResult.cs
More file actions
61 lines (54 loc) · 2.52 KB
/
ParameterExampleResult.cs
File metadata and controls
61 lines (54 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// The Sisk Framework source code
// Copyright (c) 2024- PROJECT PRINCIPIUM and all Sisk contributors
//
// The code below is licensed under the MIT license as
// of the date of its publication, available at
//
// File name: ParameterExampleResult.cs
// Repository: https://github.com/sisk-http/core
namespace Sisk.Documenting;
/// <summary>
/// Represents a parameter example used in documentation.
/// </summary>
public sealed class ParameterExampleResult {
/// <summary>
/// Gets the name of the parameter.
/// </summary>
public string ParameterName { get; init; }
/// <summary>
/// Gets the name of the parameter's type.
/// </summary>
public string TypeName { get; init; }
/// <summary>
/// Gets the description of the parameter, or <see langword="null"/> if no description is provided.
/// </summary>
public string? Description { get; init; }
/// <summary>
/// Gets a value indicating whether the parameter is required.
/// </summary>
public bool IsRequired { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="ParameterExampleResult"/> class with the specified parameter name, type name, requirement, and description.
/// </summary>
/// <param name="parameterName">The name of the parameter.</param>
/// <param name="typeName">The name of the parameter's type.</param>
/// <param name="isRequired"><see langword="true"/> if the parameter is required; otherwise, <see langword="false"/>.</param>
/// <param name="description">The description of the parameter, or <see langword="null"/> if no description is provided.</param>
public ParameterExampleResult ( string parameterName, string typeName, bool isRequired, string? description ) {
ParameterName = parameterName;
TypeName = typeName;
IsRequired = isRequired;
Description = description;
}
/// <summary>
/// Initializes a new instance of the <see cref="ParameterExampleResult"/> class with the specified parameter name, type name, and requirement.
/// </summary>
/// <param name="parameterName">The name of the parameter.</param>
/// <param name="typeName">The name of the parameter's type.</param>
/// <param name="isRequired"><see langword="true"/> if the parameter is required; otherwise, <see langword="false"/>.</param>
public ParameterExampleResult ( string parameterName, string typeName, bool isRequired ) {
ParameterName = parameterName;
TypeName = typeName;
IsRequired = isRequired;
}
}