55namespace CasParser \CasGenerator ;
66
77use CasParser \CasGenerator \CasGeneratorGenerateCasParams \CasAuthority ;
8- use CasParser \Core \Attributes \Api ;
8+ use CasParser \Core \Attributes \Optional ;
9+ use CasParser \Core \Attributes \Required ;
910use CasParser \Core \Concerns \SdkModel ;
1011use CasParser \Core \Concerns \SdkParams ;
1112use CasParser \Core \Contracts \BaseModel ;
1819 *
1920 * @phpstan-type CasGeneratorGenerateCasParamsShape = array{
2021 * email: string,
21- * from_date : string,
22+ * fromDate : string,
2223 * password: string,
23- * to_date : string,
24- * cas_authority ?: CasAuthority|value-of<CasAuthority>,
25- * pan_no ?: string,
24+ * toDate : string,
25+ * casAuthority ?: null| CasAuthority|value-of<CasAuthority>,
26+ * panNo ?: string|null ,
2627 * }
2728 */
2829final class CasGeneratorGenerateCasParams implements BaseModel
@@ -34,48 +35,48 @@ final class CasGeneratorGenerateCasParams implements BaseModel
3435 /**
3536 * Email address to receive the CAS document.
3637 */
37- #[Api ]
38+ #[Required ]
3839 public string $ email ;
3940
4041 /**
4142 * Start date for the CAS period (format YYYY-MM-DD).
4243 */
43- #[Api ]
44- public string $ from_date ;
44+ #[Required( ' from_date ' ) ]
45+ public string $ fromDate ;
4546
4647 /**
4748 * Password to protect the generated CAS PDF.
4849 */
49- #[Api ]
50+ #[Required ]
5051 public string $ password ;
5152
5253 /**
5354 * End date for the CAS period (format YYYY-MM-DD).
5455 */
55- #[Api ]
56- public string $ to_date ;
56+ #[Required( ' to_date ' ) ]
57+ public string $ toDate ;
5758
5859 /**
5960 * CAS authority to generate the document from (currently only kfintech is supported).
6061 *
61- * @var value-of<CasAuthority>|null $cas_authority
62+ * @var value-of<CasAuthority>|null $casAuthority
6263 */
63- #[Api( enum: CasAuthority::class, optional: true )]
64- public ?string $ cas_authority ;
64+ #[Optional( ' cas_authority ' , enum: CasAuthority::class)]
65+ public ?string $ casAuthority ;
6566
6667 /**
6768 * PAN number (optional for some CAS authorities).
6869 */
69- #[Api(optional: true )]
70- public ?string $ pan_no ;
70+ #[Optional( ' pan_no ' )]
71+ public ?string $ panNo ;
7172
7273 /**
7374 * `new CasGeneratorGenerateCasParams()` is missing required properties by the API.
7475 *
7576 * To enforce required parameters use
7677 * ```
7778 * CasGeneratorGenerateCasParams::with(
78- * email: ..., from_date : ..., password: ..., to_date : ...
79+ * email: ..., fromDate : ..., password: ..., toDate : ...
7980 * )
8081 * ```
8182 *
@@ -99,71 +100,71 @@ public function __construct()
99100 *
100101 * You must use named parameters to construct any parameters with a default value.
101102 *
102- * @param CasAuthority|value-of<CasAuthority> $cas_authority
103+ * @param CasAuthority|value-of<CasAuthority>|null $casAuthority
103104 */
104105 public static function with (
105106 string $ email ,
106- string $ from_date ,
107+ string $ fromDate ,
107108 string $ password ,
108- string $ to_date ,
109- CasAuthority |string |null $ cas_authority = null ,
110- ?string $ pan_no = null ,
109+ string $ toDate ,
110+ CasAuthority |string |null $ casAuthority = null ,
111+ ?string $ panNo = null ,
111112 ): self {
112- $ obj = new self ;
113+ $ self = new self ;
113114
114- $ obj -> email = $ email ;
115- $ obj -> from_date = $ from_date ;
116- $ obj -> password = $ password ;
117- $ obj -> to_date = $ to_date ;
115+ $ self [ ' email ' ] = $ email ;
116+ $ self [ ' fromDate ' ] = $ fromDate ;
117+ $ self [ ' password ' ] = $ password ;
118+ $ self [ ' toDate ' ] = $ toDate ;
118119
119- null !== $ cas_authority && $ obj [ ' cas_authority ' ] = $ cas_authority ;
120- null !== $ pan_no && $ obj -> pan_no = $ pan_no ;
120+ null !== $ casAuthority && $ self [ ' casAuthority ' ] = $ casAuthority ;
121+ null !== $ panNo && $ self [ ' panNo ' ] = $ panNo ;
121122
122- return $ obj ;
123+ return $ self ;
123124 }
124125
125126 /**
126127 * Email address to receive the CAS document.
127128 */
128129 public function withEmail (string $ email ): self
129130 {
130- $ obj = clone $ this ;
131- $ obj -> email = $ email ;
131+ $ self = clone $ this ;
132+ $ self [ ' email ' ] = $ email ;
132133
133- return $ obj ;
134+ return $ self ;
134135 }
135136
136137 /**
137138 * Start date for the CAS period (format YYYY-MM-DD).
138139 */
139140 public function withFromDate (string $ fromDate ): self
140141 {
141- $ obj = clone $ this ;
142- $ obj -> from_date = $ fromDate ;
142+ $ self = clone $ this ;
143+ $ self [ ' fromDate ' ] = $ fromDate ;
143144
144- return $ obj ;
145+ return $ self ;
145146 }
146147
147148 /**
148149 * Password to protect the generated CAS PDF.
149150 */
150151 public function withPassword (string $ password ): self
151152 {
152- $ obj = clone $ this ;
153- $ obj -> password = $ password ;
153+ $ self = clone $ this ;
154+ $ self [ ' password ' ] = $ password ;
154155
155- return $ obj ;
156+ return $ self ;
156157 }
157158
158159 /**
159160 * End date for the CAS period (format YYYY-MM-DD).
160161 */
161162 public function withToDate (string $ toDate ): self
162163 {
163- $ obj = clone $ this ;
164- $ obj -> to_date = $ toDate ;
164+ $ self = clone $ this ;
165+ $ self [ ' toDate ' ] = $ toDate ;
165166
166- return $ obj ;
167+ return $ self ;
167168 }
168169
169170 /**
@@ -173,20 +174,20 @@ public function withToDate(string $toDate): self
173174 */
174175 public function withCasAuthority (CasAuthority |string $ casAuthority ): self
175176 {
176- $ obj = clone $ this ;
177- $ obj [ ' cas_authority ' ] = $ casAuthority ;
177+ $ self = clone $ this ;
178+ $ self [ ' casAuthority ' ] = $ casAuthority ;
178179
179- return $ obj ;
180+ return $ self ;
180181 }
181182
182183 /**
183184 * PAN number (optional for some CAS authorities).
184185 */
185186 public function withPanNo (string $ panNo ): self
186187 {
187- $ obj = clone $ this ;
188- $ obj -> pan_no = $ panNo ;
188+ $ self = clone $ this ;
189+ $ self [ ' panNo ' ] = $ panNo ;
189190
190- return $ obj ;
191+ return $ self ;
191192 }
192193}
0 commit comments