/
IInputComponentBuilder.cs
116 lines (100 loc) · 3.67 KB
/
IInputComponentBuilder.cs
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
using System;
using System.Collections.Generic;
using System.Reflection;
namespace Discord.Interactions.Builders
{
/// <summary>
/// Represent a builder for creating <see cref="InputComponentInfo"/>.
/// </summary>
public interface IInputComponentBuilder
{
/// <summary>
/// Gets the parent modal of this input component.
/// </summary>
ModalBuilder Modal { get; }
/// <summary>
/// Gets the custom id of this input component.
/// </summary>
string CustomId { get; }
/// <summary>
/// Gets the label of this input component.
/// </summary>
string Label { get; }
/// <summary>
/// Gets whether this input component is required.
/// </summary>
bool IsRequired { get; }
/// <summary>
/// Gets the component type of this input component.
/// </summary>
ComponentType ComponentType { get; }
/// <summary>
/// Get the reference type of this input component.
/// </summary>
Type Type { get; }
/// <summary>
/// Get the <see cref="PropertyInfo"/> of this component's property.
/// </summary>
PropertyInfo PropertyInfo { get; }
/// <summary>
/// Get the <see cref="ComponentTypeConverter"/> assigned to this input.
/// </summary>
ComponentTypeConverter TypeConverter { get; }
/// <summary>
/// Gets the default value of this input component.
/// </summary>
object DefaultValue { get; }
/// <summary>
/// Gets a collection of the attributes of this component.
/// </summary>
IReadOnlyCollection<Attribute> Attributes { get; }
/// <summary>
/// Sets <see cref="CustomId"/>.
/// </summary>
/// <param name="customId">New value of the <see cref="CustomId"/>.</param>
/// <returns>
/// The builder instance.
/// </returns>
IInputComponentBuilder WithCustomId(string customId);
/// <summary>
/// Sets <see cref="Label"/>.
/// </summary>
/// <param name="label">New value of the <see cref="Label"/>.</param>
/// <returns>
/// The builder instance.
/// </returns>
IInputComponentBuilder WithLabel(string label);
/// <summary>
/// Sets <see cref="IsRequired"/>.
/// </summary>
/// <param name="isRequired">New value of the <see cref="IsRequired"/>.</param>
/// <returns>
/// The builder instance.
/// </returns>
IInputComponentBuilder SetIsRequired(bool isRequired);
/// <summary>
/// Sets <see cref="Type"/>.
/// </summary>
/// <param name="type">New value of the <see cref="Type"/>.</param>
/// <returns>
/// The builder instance.
/// </returns>
IInputComponentBuilder WithType(Type type);
/// <summary>
/// Sets <see cref="DefaultValue"/>.
/// </summary>
/// <param name="value">New value of the <see cref="DefaultValue"/>.</param>
/// <returns>
/// The builder instance.
/// </returns>
IInputComponentBuilder SetDefaultValue(object value);
/// <summary>
/// Adds attributes to <see cref="Attributes"/>.
/// </summary>
/// <param name="attributes">New attributes to be added to <see cref="Attributes"/>.</param>
/// <returns>
/// The builder instance.
/// </returns>
IInputComponentBuilder WithAttributes(params Attribute[] attributes);
}
}