44
55namespace Rsk . AuthZen . Client
66{
7+ /// <summary>
8+ /// Represents a request body for a boxcar evaluation in AuthZen, containing multiple evaluations,
9+ /// default values, and evaluation options.
10+ /// </summary>
711 public class AuthZenBoxcarEvaluationBody
812 {
13+ /// <summary>
14+ /// Gets the list of individual evaluation bodies to be processed in the boxcar request.
15+ /// </summary>
916 public List < AuthZenEvaluationBody > Evaluations { get ; internal set ; }
17+
18+ /// <summary>
19+ /// Gets the default values to be applied to each evaluation if not explicitly set.
20+ /// </summary>
1021 public AuthZenEvaluationBody DefaultValues { get ; internal set ; }
22+
23+ /// <summary>
24+ /// Gets the options that control the semantics of the boxcar evaluation.
25+ /// </summary>
1126 public AuthZenBoxcarOptions Options { get ; internal set ; }
12-
27+
28+ /// <summary>
29+ /// Converts this instance to a <see cref="AuthZenBoxcarRequestMessageDto"/> for transmission.
30+ /// </summary>
31+ /// <returns>The corresponding <see cref="AuthZenBoxcarRequestMessageDto"/>.</returns>
1332 internal AuthZenBoxcarRequestMessageDto ToDto ( )
1433 {
1534 var dto = new AuthZenBoxcarRequestMessageDto ( ) ;
@@ -53,7 +72,7 @@ internal AuthZenBoxcarRequestMessageDto ToDto()
5372 dto . Evaluations [ i ] = Evaluations [ i ] . ToDto ( ) ;
5473 }
5574 }
56-
75+
5776 if ( Options != null )
5877 {
5978 dto . Options = Options . ToDto ( ) ;
@@ -63,26 +82,58 @@ internal AuthZenBoxcarRequestMessageDto ToDto()
6382 }
6483 }
6584
85+ /// <summary>
86+ /// Represents the response from a boxcar evaluation request in AuthZen,
87+ /// including a correlation identifier and the results of individual evaluations.
88+ /// </summary>
6689 public class AuthZenBoxcarResponse
6790 {
91+ /// <summary>
92+ /// Gets the correlation identifier for the boxcar evaluation request.
93+ /// </summary>
6894 public string CorrelationId { get ; internal set ; }
95+
96+ /// <summary>
97+ /// Gets the list of evaluation results returned by the boxcar request.
98+ /// </summary>
6999 public List < AuthZenResponse > Evaluations { get ; internal set ; }
70100 }
71101
102+ /// <summary>
103+ /// Defines the semantics for boxcar evaluations in AuthZen.
104+ /// </summary>
72105 public enum BoxcarSemantics
73106 {
107+ /// <summary>
108+ /// Indicates that all evaluations should be executed.
109+ /// </summary>
74110 ExecuteAll ,
111+
112+ /// <summary>
113+ /// Indicates that the evaluation should stop and deny on the first deny result.
114+ /// </summary>
75115 DenyOnFirstDeny ,
116+
117+ /// <summary>
118+ /// Indicates that the evaluation should stop and permit on the first permit result.
119+ /// </summary>
76120 PermitOnFirstPermit
77121 }
78122
79- // execute_all
80- // deny_on_first_deny
81- // permit_on_first_permit
123+ /// <summary>
124+ /// Represents the options for a boxcar evaluation in AuthZen, including evaluation semantics.
125+ /// </summary>
82126 public class AuthZenBoxcarOptions
83127 {
128+ /// <summary>
129+ /// Gets the semantics that control the evaluation behavior in the boxcar request.
130+ /// </summary>
84131 public BoxcarSemantics Semantics { get ; internal set ; }
85-
132+
133+ /// <summary>
134+ /// Converts this instance to a <see cref="AuthZenBoxcarOptionsDto"/> for transmission.
135+ /// </summary>
136+ /// <returns>The corresponding <see cref="AuthZenBoxcarOptionsDto"/>.</returns>
86137 internal AuthZenBoxcarOptionsDto ToDto ( )
87138 {
88139 return new AuthZenBoxcarOptionsDto
@@ -91,6 +142,12 @@ internal AuthZenBoxcarOptionsDto ToDto()
91142 } ;
92143 }
93144
145+ /// <summary>
146+ /// Converts the <see cref="BoxcarSemantics"/> enumeration value to its string representation.
147+ /// </summary>
148+ /// <param name="semantics">The semantics to convert.</param>
149+ /// <returns>The string representation of the semantics.</returns>
150+ /// <exception cref="ArgumentException">Thrown if the semantics value is not supported.</exception>
94151 private static string ConvertSemantics ( BoxcarSemantics semantics )
95152 {
96153 return semantics switch
0 commit comments